I'm filtering passwords in my Rails 3.1 app's config/application.rb file as usual with:
config.filter_parameters += [:password]
However, I'm got an email field in two different models, and I'd like to filter email from only one of those models. Is there a way to do this?
I know this question is really old, but I got here before finding the solution elsewhere. So I'll post an answer in case it helps someone:
In Rails 7, you can do:
class MyModel < ApplicationRecord
self.filter_attributes += [ :email ]
end
to filter attributes per model
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With