How to filter parameters in rails?

前端 未结 5 707
南笙
南笙 2020-12-13 12:03

Rails has built in log filtering so you don\'t log passwords and credit cards. Works great for that but when you want to trigger a custom log (like to email) and send your

5条回答
  •  既然无缘
    2020-12-13 13:03

    Rails 4+

    Sidenote for filtering the log in Rails 4+: The config.filter_parameters has been moved from application.rb to it's own initializer.

    config/initializers/filter_parameter_logging.rb

    Rails.application.config.filter_parameters += [:password]
    

提交回复
热议问题