我在我的紅寶石軌道應用程序中使用設計寶石。在用戶註冊時,如果電子郵件已存在,則會有一個默認消息「電子郵件已被使用」。更改設計消息「電子郵件已被採納」
我在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."
的問題是在開始處附加「電子郵件」。
是否有任何其他方式來更改此默認消息?該消息的到
en:
errors:
format: "%{message}"
默認
另一種選擇:https://stackoverflow.com/questions/9006270/where-can-i-change-the-email已經被採取的錯誤消息 – user1515295