Devise的错误消息在哪里?

时间:2017-07-16 05:21:00

标签: ruby-on-rails ruby devise

我想更改消息“您需要在继续之前登录或注册”。但是我找不到包含此消息的文件时遇到了问题。

我查看了与Devise相关的所有视图文件,但找不到消息,所以想知道它可能在哪里......

1 个答案:

答案 0 :(得分:1)

答案是修改config / locales / devise.en.yml但你必须添加设置,默认情况下它们不在那里。

en:
  devise:
    failure:
      unauthenticated: "change this -> You need to sign in or sign up before continuing."

对于设计的其他自定义错误消息,您可以找到https://github.com/plataformatec/devise/blob/master/config/locales/en.yml