I have Devise and CanCan in my Rails app. I think by default, it should redirect users to sign-in page if users try to login to unauthorized page. But somehow, it doesn’t work for my app.
How to I implement a checking if users are authorized and redirect to home if not globally (i.e., for all controllers/methods)?
UPDATE: It seems that my CanCan doesn’t work anymore after updating jquery.
Thank you.
It should work, show us your
routes.rbfile. To check just addbefore_filter :authenticate_member!on top of your controller class.