微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ruby-on-rails-3.2 – devise.registrations.yasons文件中的原因已被弃用?

我刚刚更新到Rails 3.2,在启动WEBrick之后,我得到以下错误
[DEVISE] devise.registrations.reasons in yml files is deprecated,please use devise.registrations.signed_up_but_REASON instead. The default values are:

en:
  devise:
    registrations:
      signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
      signed_up_but_inactive: 'You have signed up successfully. However,we Could not sign you in because your account is not yet activated.'
      signed_up_but_locked: 'You have signed up successfully. However,we Could not sign you in because your account is locked.'



[DEVISE] devise.registrations.inactive_signed_up in yml files is deprecated,we Could not sign you in because your account is locked.'

在我的设计语言环境文件我有另一行:

registrations:
      signed_up: 'Welcome! You have signed up successfully.'
      inactive_signed_up: 'You have signed up successfully. However,we Could not sign you in because your account is %{reason}.'
      updated: 'You updated your account successfully.'
      destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
      reasons:
        inactive: 'inactive'
        unconfirmed: 'unconfirmed'
        locked: 'locked'

对不起,我是一名Rails初学者.我究竟要改变什么?如何?

解决方法

我刚刚遇到这个.这似乎工作正常:

在config>地区> devise.en.yml>关于第36行将注册块更改为:

registrations:
    signed_up: 'Welcome! You have signed up successfully.'
    updated: 'You updated your account successfully.'
    destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
    signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
    signed_up_but_inactive: 'You have signed up successfully. However,we Could not sign you in because your account is not yet activated.'
    signed_up_but_locked: 'You have signed up successfully. However,we Could not sign you in because your account is locked.'

BTW:确保删除位:

reasons:
    inactive: 'inactive'
    unconfirmed: 'unconfirmed'
    locked: 'locked'

干杯,无光泽

原文地址:https://www.jb51.cc/ruby/267234.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐