Make rails ignore inputs if user is admin
I have a user object, he can update his profile which includes name,
user_name, password (blank), password_confirmation (blank), email,
email_confirmation (blank), bio and picture url.
My model states that all of the (blank) MUST be filled in. but if your
admin and your just going to the users page to update the user's role -
You as the admin should not have to fill in user data you obviously don't
know.
So how does one get around this? should I instead create a list of users
with a drop down beside them? is this not, essentially , a giant form? If
so - how would this get created?
essentially: What's the best way to deal with this situation?
No comments:
Post a Comment