Created
January 12, 2017 17:38
-
-
Save Boztown/d63e7e8941ea0da0bc0263d42dfa57b8 to your computer and use it in GitHub Desktop.
Rails snippet to trace redirects
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
# 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