Forked from kinopyo/redirect_referrer_or_default.rb
Last active
August 29, 2015 14:25
-
-
Save exocode/a107fb8eac0ecc8f39b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def redirect_back_or_default(default) | |
| redirect_to(session[:return_to] || default) | |
| session[:return_to] = nil | |
| end | |
| def redirect_referrer_or_default(default) | |
| redirect_to(request.referrer || default) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment