开发者

Devise current_user after sign up redirects to my own controller?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜