Redirect to a different url after login using Devise


I have just started to use devise for authentication, I have it kind of working but I would like it to redirect_to a different url instead of root_path after many hours of googling I haven’t managed to get this working a lot of the posts say to override the after_sigin_in_path_for method in ApplicationController, which I have but my test is still expecting to see “welcome” when it should be yelling that products_path does not exist meaning it is not redirecting after a login.

def after_sign_in_path_for(resource)

I think it’s after_sign_in_path_for

1 Like

I made a very silly mistake and forgot to add click_button 'Login' to my test, therefore not actually doing anything, the above method does work.


Not to worry, @scott… I’ve made my share of silly mistakes :=). That’s why it’s great to have a place like this to get support.

1 Like