Method: Devise::Controllers::Helpers#sign_out_and_redirect

Defined in:
lib/devise/controllers/helpers.rb

#sign_out_and_redirect(resource_or_scope) ⇒ Object

Sign out a user and tries to redirect to the url specified by after_sign_out_path_for.



247
248
249
250
251
252
# File 'lib/devise/controllers/helpers.rb', line 247

def sign_out_and_redirect(resource_or_scope)
  scope = Devise::Mapping.find_scope!(resource_or_scope)
  redirect_path = after_sign_out_path_for(scope)
  Devise.sign_out_all_scopes ? sign_out : sign_out(scope)
  redirect_to redirect_path
end