Created
September 3, 2011 22:24
-
-
Save schleg/1191875 to your computer and use it in GitHub Desktop.
one time redirect
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_once_to(path) | |
route = ActionController::Routing::Routes.recognize_path(path) | |
redirect_to path unless route[:controller] == controller_name && route[:action] == action_name | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment