我在我的ruby on rails应用程序中使用了devise gem.在用户注册时,如果已存在电子邮件,则会显示默认消息"已收到电子邮件".
我在en.yml中更改了此消息
activerecord:
errors:
messages:
taken: "User with same email already exists. Please try with another email address."
Run Code Online (Sandbox Code Playgroud)
在视图中我使用过:
<div class="notice"><%= devise_error_messages! %></div>
Run Code Online (Sandbox Code Playgroud)
现在我得到的信息是
"Email User with same email already exists. Please try with another email address."
Run Code Online (Sandbox Code Playgroud)
问题是在开始时附加了"电子邮件".
有没有其他方法可以更改此默认消息?
我想将此错误消息替换为更具指导性的内容,以帮助用户了解下一步该怎么做。不幸的是,我似乎找不到来源。它来自哪里,我该如何修改?