【发布时间】:2013-07-10 12:06:12
【问题描述】:
我在我的 ruby on rails 应用程序中使用 devise gem。在用户注册时,如果电子邮件已存在,则默认消息“电子邮件已被占用”。
我在 en.yml 中更改了这条消息
activerecord:
errors:
messages:
taken: "User with same email already exists. Please try with another email address."
在我使用过的视图中:
<div class="notice"><%= devise_error_messages! %></div>
现在我收到的信息是
"Email User with same email already exists. Please try with another email address."
问题是在开头附加了“电子邮件”。
还有其他方法可以更改此默认消息吗?
【问题讨论】:
标签: ruby-on-rails devise