Flowdock
method

except

Importance_1
Ruby on Rails latest stable (v4.1.8) - 1 note - Class: Hash
except(*keys) public

Returns a hash that includes everything but the given keys. This is useful for limiting a set of parameters to everything but a few known toggles:

@person.update(params[:person].except(:admin))
Show source
Register or log in to add new notes.
May 1, 2014
0 thanks

Passing an array of keys to exclude.

Use the “*” before passing the array in. For example:

PARAMS_TO_SCRUB = [ :created_at, :updated, :id, :format ]

params.except!( *PARAMS_TO_SCRUB )