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 enter image description here

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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -