instance method
extract!
Ruby on Rails 5.2.8.1
Since v4.2.9Signature
extract!(*keys)
Removes and returns the key/value pairs matching the given keys.
params = ActionController::Parameters.new(a: 1, b: 2, c: 3) params.extract!(:a, :b) # => <ActionController::Parameters {"a"=>1, "b"=>2} permitted: false> params # => <ActionController::Parameters {"c"=>3} permitted: false>
Parameters
-
keysrest
Source
# File actionpack/lib/action_controller/metal/strong_parameters.rb, line 637
def extract!(*keys)
new_instance_with_inherited_permitted_status(@parameters.extract!(*keys))
end
Defined in actionpack/lib/action_controller/metal/strong_parameters.rb line 637
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Parameters