I know in the model we can add validations. But how about if I need
different validations depending on the controller.

For example...
1) if the User is being created from the accounts controller, I want to
REQUIRE the username be entered.
2) if the User is being created from the users controller, I want to NOT
REQUIRE the username.

validates_presence_of :username, :on => :create requires the username
regardless of the controller being used.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to