instance method
[]
Ruby on Rails 4.1.16
Since v4.0.13Signature
[](key)
Returns a parameter for the given key. If not found, returns nil.
params = ActionController::Parameters.new(person: { name: 'Francesco' }) params[:person] # => {"name"=>"Francesco"} params[:none] # => nil
Parameters
-
keyreq
Source
# File actionpack/lib/action_controller/metal/strong_parameters.rb, line 286
def [](key)
convert_hashes_to_parameters(key, super)
end
Defined in actionpack/lib/action_controller/metal/strong_parameters.rb line 286
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Parameters