我正在尝试在注册后设计重定向到自定义页面。它不起作用。我有以下自定义注册控制器:
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 }
有趣的是注册控制器正在工作,因为第一个puts语句出现在服务器日志中。但是,第二个和第三个put语句(在after_sign_up_path_for和after_inactive_sign_up_path_for中)没有出现。
如何在注册上班后获得重定向?