Created
February 25, 2012 02:51
-
-
Save danhodge/1905471 to your computer and use it in GitHub Desktop.
Rails Parameter Filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run from the console of your Rails project | |
param_filter = ActionDispatch::Http::ParameterFilter.new([:foo, :bar]) | |
param_filter.filter("foo" => "hi") # => {"foo"=>"[FILTERED]"} | |
param_filter.filter("BAR" => "123") # => {"BAR"=>"[FILTERED]"} | |
param_filter.filter("Food" => "nachos") # => {"Food"=>"[FILTERED]"} | |
param_filter.filter("hobart" => "australia") # => {"hobart"=>"[FILTERED]"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment