11155
(-- --)
September 2, 2014, 12:26pm
1
In my Rails 4 application, when I have a form including a password, i.e.
<%= password_field_tag 'admpwd', nil, size:32, maxlength: 32, class:
'admentry' %>
I don't like the fact that the password is shown plain text in the log
file, and would like to disable this. I found several suggestions to
place the call
filter_parameter_logging "password"
into application.rb, but when I do it, I get the error message
undefined method `filter_parameter_logging' for
Tamsin::Application:Class
How can I do this correctly?
hassan
(Hassan Schroeder)
September 2, 2014, 2:33pm
2
Hint: look at your initializers.
11155
(-- --)
September 3, 2014, 9:20am
3
Hassan Schroeder wrote in post #1156593:
In my Rails 4 application, when I have a form including a password, i.e.
I don't like the fact that the password is shown plain text in the log
file, and would like to disable this.
How can I do this correctly?
Hint: look at your initializers.
Thanks, that was it!
Just for the record:
The default content of
config/initializers/filter_parameter_logging.rb
(which was probably generated automatically with my rails application)
is
Rails.application.config.filter_parameters += [:password]
Since my password field is named differently, I had to add it to this
list:
Rails.application.config.filter_parameters += [:password,:admpwd]