Exception: ActionController::ParameterMissing
- Defined in:
- actionpack/lib/action_controller/metal/strong_parameters.rb
Overview
Raised when a required parameter is missing.
params = ActionController::Parameters.new(a: {})
params.fetch(:b)
# => ActionController::ParameterMissing: param not found: b
params.require(:a)
# => ActionController::ParameterMissing: param not found: a
Instance Attribute Summary collapse
-
#param ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(param) ⇒ ParameterMissing
constructor
:nodoc:.
Constructor Details
#initialize(param) ⇒ ParameterMissing
:nodoc:
18 19 20 21 |
# File 'actionpack/lib/action_controller/metal/strong_parameters.rb', line 18 def initialize(param) # :nodoc: @param = param super("param not found: #{param}") end |
Instance Attribute Details
#param ⇒ Object (readonly)
:nodoc:
16 17 18 |
# File 'actionpack/lib/action_controller/metal/strong_parameters.rb', line 16 def param @param end |