Ruby on Rails
Wednesday, October 14, 2015
Hi everyone,
In a User model has 4 columns mandatory I have used validate presence true first_name, last_name, username, country.
Now if the user is admin and when I want to update his details I don't want to check country I want validate presence part from country. In this case how can I do it. I want to update admin who is also user in User model but I want to skip couple of column and need to check rest of the columns to validate presence.
Kindly let me know how it can be done.
Cheers!!!
-- In a User model has 4 columns mandatory I have used validate presence true first_name, last_name, username, country.
Now if the user is admin and when I want to update his details I don't want to check country I want validate presence part from country. In this case how can I do it. I want to update admin who is also user in User model but I want to skip couple of column and need to check rest of the columns to validate presence.
Kindly let me know how it can be done.
Cheers!!!
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/407d73af-950a-4b36-a2a9-6518fb9e7aa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment