slice(*keys)
Instance Public methods
Returns a new ActionController::Parameters
instance that
includes only the given keys
. If the given keys
don't exist, returns an empty hash.
1 2 3 | params = ActionController::Parameters. new (a: 1 , b: 2 , c: 3 ) params.slice( :a , :b ) # => {"a"=>1, "b"=>2} params.slice( :d ) # => {} |
Please login to continue.