You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Osazeme Usen edited this page Feb 17, 2017
·
8 revisions
In your application controller file app/controllers/application_controller.rb include the following private method (below private):
classApplicationController < ActionController::Baseprivate# Overwriting the sign_out redirect path methoddefafter_sign_out_path_for(resource_or_scope)root_pathendend
The return value of this method is the redirect url after sign-out, so you should swap root_path to set where devise redirects the users after signing out. The method is overloading the one contained in lib/devise/controllers/helpers.rb
within the gem.
In scenarios you'll need to redirect to path based on multiple instances of models.
Example.. you may have current_user and current_admin as login instances.