Flowdock
method

slice

Importance_1
v5.0.0.1 - Show latest stable - 0 notes - Class: Parameters
slice(*keys) public

Returns a new ActionController::Parameters instance that includes only the given keys. If the given keys don’t exist, returns an empty hash.

params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
params.slice(:a, :b) # => {"a"=>1, "b"=>2}
params.slice(:d)     # => {}
Show source
Register or log in to add new notes.