开发者

Devise current_user after sign up redirects to my own controller?

开发者 https://www.devze.com 2023-02-08 08:33 出处:网络
i\'m using devise as an authentication ge开发者_Python百科m. Sign in works fine after it redirects to town#index through :

i'm using devise as an authentication ge开发者_Python百科m. Sign in works fine after it redirects to town#index through :

  namespace :user do
    root :to => "town#index"
  end

However, when i first sign up a user, it seems that current_user is not passed to the town controller and i get and error. Why is that happening ? Is there a way to fix ?


It's not clear from your question, so I'll assume that you're creating User instances yourself.

After signing up a new user, you need to call sign_in @user or current_user will stay nil.

0

精彩评论

暂无评论...
验证码 换一张
取 消