Skip to content

Instantly share code, notes, and snippets.

@schleg
Created September 3, 2011 22:24
Show Gist options
  • Save schleg/1191875 to your computer and use it in GitHub Desktop.
Save schleg/1191875 to your computer and use it in GitHub Desktop.
one time redirect
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