Underscore Params
Forces all param keys in Rails to be underscored. eg
{'anObject' => 'value'} turns into {'an_object' => 'value'}
Will underscore all param keys including deeply nested ones.
Helpful if you do not have control over the view layer / what params are being sent to the application and don't want to complicate controllers / models with conversion logic.
Installation
Add this line to your application's Gemfile:
gem 'underscore_params'
And then execute:
$ bundle
Or install it yourself as:
$ gem install underscore_params
Usage
- Just reference in Gemfile
- Works for Rails 4+ (not tested on earlier versions)
Contributing
- Fork it ( http://github.com/ansonK/underscore_params/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
Underscore Params is released under the MIT License.