Last Updated: February 25, 2016
·
484
· matiasdim

Avoiding some parameters - [Small RoR tip #1]

When you need a list of parameters, but no need some of them, you can do it easily by specifying which params you want to avoid getting, doing the following:

params.except(:symbol, :symbol_2)

Inside the brackets, separated by comas, are the parameter symbols you want to ignore.

For example , the way to ignore controller and action params is:

params.except(:action, :controller)

Enjoy it.