设计显示未经身份验证的消息而不是 signed_up_but_unconfirmed

Devise showing unauthenticated message instead of signed_up_but_unconfirmed

我使用的是默认的 Devise 控制器。我假设当用户创建新帐户时,他们将被重定向到 sign_in 页面并显示 signed_up_but_unconfirmed 的闪现消息。重定向正在进行,但显示的闪存消息是 unauthenticated

为什么我需要告诉 Devise 在创建新帐户时显示 signed_up_but_unconfirmed 消息?这似乎是开箱即用的方式。

更重要的是,如何配置它以显示 signed_up_but_unconfirmed

我终于在一个较旧的问题中找到了 an answer。简而言之是这样的:

覆盖注册控制器:

rails g devise:controllers users -c=registrations

取消注释 registratons_controller 中的 after_inactive_sign_up_path_for 方法:

def after_inactive_sign_up_path_for(resource)
  new_user_session_path
end