Created
September 24, 2010 14:14
-
-
Save hynkle/595442 to your computer and use it in GitHub Desktop.
This file contains 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
module ActionController | |
class Base | |
private | |
# For Rails (tested on 2.3.8): | |
# Displays request parameters hash pretty-printed instead of as an unreadable wall of | |
# text (but only in development environment). | |
# Toss this into config/initializers . | |
# Altered from actionpack-2.3.8/lib/action_controller/base.rb . | |
def log_processing_for_parameters | |
parameters = respond_to?(:filter_parameters) ? filter_parameters(params) : params.dup | |
parameters = parameters.except!(:controller, :action, :format, :_method) | |
unless parameters.empty? | |
params_str = Rails.env.development? ? PP.pp(parameters,'') : parameters.inspect | |
logger.info " Parameters:\n#{params_str}" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment