Reputation: 26713
I have an additional member method (and a corresponding route) called download, for which I'd like to validate the existence of a password field.
Putting :validates_presence_of :password
in my download method, I get an error claiming it's an undefined method.
Is this possible?
Upvotes: 0
Views: 74
Reputation: 4580
No, you can add errors to the model but validations live in the model. Check out the errors methods and add_to_base if you need to add errors in the controller for whatever reason.
Upvotes: 2