2
我正在使用Devise with Invitable和Confirmable。无法在设计上覆盖after_inactive_sign_up_path_for RegistrationsController
登录时,我想将用户重定向到确认页面,而不是显示Flash消息。
我在route.rb设置如下:
devise_for :users, controllers: {
:confirmations => 'confirmations',
:registrations => 'registrations'
}
而且我RegistrationsController(/app/controllers/registrations_controller.rb)是:
class RegistrationsController < Devise::RegistrationsController
protected
def after_inactive_sign_up_path_for(resource)
"http://google.com"
end
end
但无论我怎么努力,after_inactive_sign_up_path_for
没有被调用,它只是继续闪光消息。
我试用改变路由,但它没有工作。我不想覆盖after_inactive_sign_up_path_for,因为用户必须确认帐户,并且我想显示一个确认页面,而不仅仅是一个Flash通知。 – Dofs
您是否想在注册成功后或注册失败后重定向用户? –
我想在注册时重定向,但在帐户被确认之前。 – Dofs