Philip7899
Philip7899

Reputation: 4687

How can I change devise alert message for password_confirmation

I am trying to change the alert message from the standard "doesn't match Password" to "The passwords do not match" but I can't figure out how to do it. I've already tried adding the following to my devise.en.yml file:

activerecord:
    errors:  
      models:
        user:
          attributes:
            password:  
              confirmation: "hey you billy"
              blank: "cannot be blank."
              invalid: "this password be invalid yo"

but this does not work. The blank message works but confirmation does not. Does anyone know how to fix this?

Upvotes: 1

Views: 912

Answers (1)

dawner
dawner

Reputation: 468

Try setting 'confirmation' on the 'password_confirmation' attribute instead;

activerecord:
    errors:  
      models:
        user:
          attributes:
            password_confirmation:
              confirmation: "The passwords do not match"

Upvotes: 2

Related Questions