3

I need a config.filter_parameters (Rails 3.x.x) equivalent for Rails 2.3.x

module SampleApp
  class Application < Rails::Application
    # Configure sensitive parameters which will be filtered from the log file.
    config.filter_parameters += [:password]
  end
end

That works on Rails 3 but it need that functionality in Rails 2.3.x.

Leo Gallucci
  • 16,355
  • 12
  • 77
  • 110

1 Answers1

5

Put the following inside your controller:

filter_parameter_logging :password

You could put it into your application controller and have the behavior extend to all your controllers or you can put it into just the controllers that need filtering. I recommend the application controller approach because it is more of a whitelist approach that is less prone to error.

brettish
  • 2,628
  • 3
  • 17
  • 22