小编NAR*_*AJU的帖子

如何更改 Rails 5 设计中的验证错误消息

我已将密码的默认最小长度从 @@password_length = 5..128 更改为 6..128。当我在注册期间验证密码失败时,验证错误显示为“太短(最少 5 个字符)”。如何将此错误消息更改为“最少​​ 6 个字符”。我在 stackoverflow 上读到了一些 anuswers,他们说要查看devise.views.en.yml。但仍然无法更改错误消息。

我的 devise.views.en.yml (密码字段)如下所示:

passwords:
  edit:
    change_my_password: Change my password
    change_your_password: Change your password
    confirm_new_password: Confirm new password
    new_password: New password
  new:
    forgot_your_password: Forgot your password?
    send_me_reset_password_instructions: Send me reset password instructions
  no_token: You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided.
  send_instructions: You will …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails devise

2
推荐指数
1
解决办法
2054
查看次数

标签 统计

devise ×1

ruby-on-rails ×1