Search code examples
ruby-on-railsrubyruby-on-rails-3devise

Modify Devise reset password error text


Using the Devise GEM, when a user password is reset they are allowed to set a new password. If the entered passwords do not match or if the password is too short, you get default messages:

•Password doesn't match confirmation

•Password is too short (minimum is 8 characters)

How/where can I change the text of these error messages?


Solution

  • Add this to your config/locals/en.yml and change it to what you want

    en:
      activerecord:
        errors:
          models:
            user:
              attributes:
                password:
                  confirmation: "Password does not match"
                  too_short: "is too short (minimum is %{count} characters)"
        attributes:
          user:
            password: "Password"