在一个新用户上,我验证一个字段的唯一性,如果它已经存在,我添加一个带有来自语言环境的字符串的错误。
具有这种基本格式
field_error_message_uniqueness_html: "Already bla bla<br/> if bla bla contact us<a href='mailto:%{email}' target='_top'>%{email}</a>."
当我在开发环境中进行测试时,它工作得很好,但在 heroku 上它显示得好像不是 html。发展
Already bla bla
if bla bla contact us info@mail.com
heroku
Already bla bla<br/> if bla bla contact us <a href='mailto:info@mail.com' target='_top'>info@mail.com</a>.
我的错误添加代码
validates_uniqueness_of :field_number,
allow_blank: true,
:message=>(I18n.t :field_error_message_uniqueness_html, scope: "activerecord.attributes.user", email: ApplicationHelper::SUPPORT_EMAIL ).html_safe
有什么可能弄乱它?