Possible Duplicate:
Fully custom validation error message with Rails
I'm playing around with Rails 3.1rc1 and think SecurePassword will be useful for me. But, I don't like the default error message, Password digest can't be blank
. If I called validates_presence_of :password_digest
myself I could pass :message => "Password can't be blank"
but because it's in the framework I'm not sure how to override the message to remove the word "digest" which will only confuse joe user. Anyone know how to do this?
Edit:
Tried adding an 'overriding': validates_presence_of
like so:
class User < ActiveRecord::Base
attr_accessible :email, :password
has_secure_password
validates_presence_of :password_digest, :message => "Password can't be blank"
end
But when trying to submit a blank password you just get double the errors:
Form is invalid
- Password digest can't be blank
- Password digest Password can't be blank