Exception: ActionController::ParameterMissing
- Inherits:
-
KeyError
- Object
- KeyError
- ActionController::ParameterMissing
- Defined in:
- 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 is missing or the value is empty: b
params.require(:a)
# => ActionController::ParameterMissing: param is missing or the value is empty: a
Instance Attribute Summary collapse
-
#param ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(param) ⇒ ParameterMissing
constructor
:nodoc:.
Constructor Details
#initialize(param) ⇒ ParameterMissing
:nodoc:
22 23 24 25 |
# File 'lib/action_controller/metal/strong_parameters.rb', line 22 def initialize(param) # :nodoc: @param = param super("param is missing or the value is empty: #{param}") end |
Instance Attribute Details
#param ⇒ Object (readonly)
:nodoc:
20 21 22 |
# File 'lib/action_controller/metal/strong_parameters.rb', line 20 def param @param end |