Devise redirect back to the original location after sign in or sign up?

前端 未结 8 2294
野趣味
野趣味 2020-12-14 07:42

Here I\'m using Devise Gem for authentication. If someone want to open page without login then it redirect to sign_in page and after signed in it back to the page which user

8条回答
  •  醉话见心
    2020-12-14 08:27

    I has the same doubt and found this, try it too

    def after_sign_in_path_for(resource_or_scope)
      session.fetch 'user_return_to', admin_root_path
    end
    

提交回复
热议问题