【问题标题】:rails 3 + devise: how change a flash message NOT in locale file?rails 3 + 设计:如何更改不在语言环境文件中的闪存消息?
【发布时间】:2011-05-29 18:26:00
【问题描述】:

我的 rails 3 应用程序使用了 devise,我们已对其进行了设置,以便用户通过电子邮件收到确认令牌。

一旦用户注册,设计“闪烁”以下我需要更改的提示:

You have signed up successfully. However, we could not 
sign you in because your account is unconfirmed.

此消息不在 devise.en.yaml 文件中...

有谁知道如何更改此闪信?

【问题讨论】:

    标签: ruby-on-rails devise


    【解决方案1】:

    尝试在config/locales/devise.en.yml 中添加inactive_signed_up

    en:
      devise:
        registrations:
          inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
    

    【讨论】:

    • 你到底是怎么知道的?有一些我可以查看的清单吗?
    • 另外,您知道是否有办法将 %{the_email_address_user_registered} 嵌入到该 Flash 消息中,这样它就可以说“我们向 YOUREMAIL@WHATEVER.COM 发送了一封确认电子邮件......请点击确认链接”
    • 我搜索了(下载的)设计源代码,找到了here。不确定您是否可以使用当前代码将电子邮件添加到闪存,但您可以尝试覆盖控制器。 Some code
    • 这个真的应该在他们的wiki上。搜索源代码不是可接受的文档。
    猜你喜欢
    • 2014-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-01
    • 2012-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多