Hi all,
I do a save on some user information in controller called my_controller.
In my model for User I have a validation for the password:
validates_format_of :password, :with => /^\w+$/, :message => ‘Password must be alphanumeric’, :on => :save
What I need to do, in this case, is to validate the save except for when
the save is called by this method in this controller. For example, I
would like to say:
validates_format_of :password, :with => /^\w+$/, :message => ‘Password must be alphanumeric’, :on => :save, except =>
[:submit]
However, the problem here is that :submit is the name for a method in
the controller and not the model where this validation is taking place.
And because I never pass the password along as a parameter, the
validation always fails. Is there a way to do this? Thanks,
-Shandy