Rails has hidden gems just waiting to be discovered. I will demonstrate the use of Hash.slice, which is one of the core extensions of ActiveSupport.
Here is an example of how Hash.slice can clean up a controller, take this existing code for example:
1 2 3
With Hash.slice we can shorten it to:
1 2 3
Hash.slice is that it is very forgiving. The method only returns the attributes if they exist. In our example we are assured all conditions will be met because the default values will only be overwritten if Hash.slice returns them.