ruby on rails - client_side_validations and devise error messages -
im validating form client side validations , have devise, in form:
<fieldset> <div class="control-group"> <%= f.label :current_password, "old password:", :class => "control-label" %> <div class="controls"> <%= f.password_field :current_password %> </div> </div> <div class="control-group"> <%= f.label :password, "new password:", :class => "control-label" %> <div class="controls"> <%= f.password_field :password %> </div> </div> <div class="control-group"> <%= f.label :password_confirmation, "new password, again:", :class => "control-label" %> <div class="controls"> <%= f.password_field :password_confirmation %> </div> </div> </fieldset>
and have in model
validates_presence_of :password, :message => 'required'
validates_presence_of :password_confirmation, :message => 'required'
validates_presence_of :current_password, :message => 'required'
in end view shows
why messages different? have messages consistent. how change default message?
thank you.
edit config/locales/en.yml
file, so:
en: activerecord: errors: models: user: attributes: current_password: blank: "required"
note need replace user
actual name of model.
Comments
Post a Comment