Skip to content

Instantly share code, notes, and snippets.

@danhodge
Created February 25, 2012 02:51
Show Gist options
  • Save danhodge/1905471 to your computer and use it in GitHub Desktop.
Save danhodge/1905471 to your computer and use it in GitHub Desktop.
Rails Parameter Filters
# 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