Skip to content

Instantly share code, notes, and snippets.

@thesunwave
Created October 27, 2014 11:39
Show Gist options
  • Save thesunwave/9c1afd4f7db4b18f1867 to your computer and use it in GitHub Desktop.
Save thesunwave/9c1afd4f7db4b18f1867 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
def after_sign_in_path_for(resource)
root_path
end
def after_sign_out_path_for(resource_or_scope)
request.referrer
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment