Skip to content

Instantly share code, notes, and snippets.

@ksarna
Created May 4, 2011 12:13
Show Gist options
  • Save ksarna/955129 to your computer and use it in GitHub Desktop.
Save ksarna/955129 to your computer and use it in GitHub Desktop.
Handling ajax redirection in rails
def redirect_to(options = {}, response_status = {})
if request.xhr?
render(:update) {|page| page.redirect_to(options)}
else
super(options, response_status)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment