Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Redirect to root_url after sign_out? #224

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

amrit commented Oct 8, 2012

I think it would be better to redirect back to redirect to theroot_url instead of redirecting to the sign_in page after signing out.

@ghost ghost assigned harlow Oct 18, 2012

Contributor

harlow commented Oct 22, 2012

Hi @aayalur here is a solution to adding a custom sign out url.

Add a new route to your routes.rb file. This will route the sign_out_path to your new SessionsController

# config/routes.rb
match '/sign_out' => 'sessions#destroy', as: 'sign_out', via: :delete

Then in the newly created SessionsController implement the url_after_destroy method which will return the root_url

# app/controllers/sessions_controller.b
class SessionsController < Clearance::SessionsController
  private

  def url_after_destroy
    root_url
  end
end

@harlow harlow closed this Oct 22, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment