Skip to content

Instantly share code, notes, and snippets.

@cored
Created February 19, 2014 14:48
Show Gist options
  • Save cored/9093564 to your computer and use it in GitHub Desktop.
Save cored/9093564 to your computer and use it in GitHub Desktop.
def store_location
# store last url - this is needed for post-login redirect to whatever the user last visited.
unless (sign_in_url =~ request.path ||
sign_up_url =~ request.path ||
user_confirmation =~ request.path ||
sign_password =~ request.path ||
cookies_allow =~ request.path ||
request.xhr?) # don't store ajax calls
session[:previous_url] = request.path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment