Skip to content

Instantly share code, notes, and snippets.

@Boztown
Created January 12, 2017 17:38
Show Gist options
  • Save Boztown/d63e7e8941ea0da0bc0263d42dfa57b8 to your computer and use it in GitHub Desktop.
Save Boztown/d63e7e8941ea0da0bc0263d42dfa57b8 to your computer and use it in GitHub Desktop.
Rails snippet to trace redirects
# add to application_controller.rb
# from: http://stackoverflow.com/questions/15274038/how-to-trace-redirect-to-in-a-rails-app-while-hunting-bugs
def redirect_to(options = {}, response_status = {})
::Rails.logger.error("Redirected by #{caller(1).first rescue "unknown"}")
super(options, response_status)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment