(config.filter_parameters) 相当于 Rails 2.3.5
我需要 Rails 2.3.x 的 config.filter_parameters (Rails 3.xx) 等效项
module SampleApp
class Application < Rails::Application
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
end
end
,它适用于 Rails 3,但它需要 Rails 2.3.x 中的功能。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将以下内容放入控制器中:
您可以将其放入应用程序控制器中,并将行为扩展到所有控制器中,或者您可以将其仅放入需要过滤的控制器中。我推荐应用程序控制器方法,因为它更像是一种不太容易出错的白名单方法。
Put the following inside your controller:
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.