我试图在注册后设计重定向到自定义页面。它不工作。我有以下的自定义登记控制器:after_sign_up_path_for not working - devise
class RegistrationsController < Devise::RegistrationsController
protected
puts 'Registrations controller is happening"
def after_sign_up_path_for(resource)
puts 'after_sign_up_path_for is working'
"http://www.google.com"
end
def after_inactive_sign_up_path_for(resource)
puts 'after_inactive_sign_up_path_for is working'
"http://www.google.com"
end
end
这里是我的自定义路线:
devise_for :users, :controllers => { :registrations => :registrations }
那么,什么是有趣的是,登记控制器工作时,因为第一个看跌期权声明中显示出来服务器日志。但是,第二个和第三个put语句(在after_sign_up_path_for和after_inactive_sign_up_path_for内)没有出现。
注册后如何获得重定向?
它不是重复的。我看到了这个问题,答案对我来说不起作用。 – Philip7899
你检查了其他答案吗? – Ashitaka
是的,我已经查看了所有堆栈溢出页面和我能找到的其他资源。 – Philip7899