after_sign_in_path未调用

时间:2012-07-09 13:50:52

标签: ruby-on-rails ruby devise

我有简单的RoR应用程序和设计。

这是输出耙路线

logout_index GET    /logout/index(.:format)        logout#index
        new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
            user_session POST   /users/sign_in(.:format)       devise/sessions#create
    destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
           user_password POST   /users/password(.:format)      devise/passwords#create
       new_user_password GET    /users/password/new(.:format)  devise/passwords#new
      edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                         PUT    /users/password(.:format)      devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
       user_registration POST   /users(.:format)               devise/registrations#create
   new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
  edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                         PUT    /users(.:format)               devise/registrations#update
                         DELETE /users(.:format)               devise/registrations#destroy

以下是application_controller

中的代码
class ApplicationController < ActionController::Base
  protect_from_forgery
  def after_sign_in_path()
      abort 'signed'
   end
end

问题是当用户注册时,不执行after_sign_in_path方法。 我想念的是什么?

1 个答案:

答案 0 :(得分:0)

我认为它应该是after_sign_in_path_for。请参阅here