Exception: StrongParameters::Error::UnpermittedParameters
- Inherits:
-
IndexError
- Object
- IndexError
- StrongParameters::Error::UnpermittedParameters
- Defined in:
- lib/strong_parameters/error.rb
Overview
Raised when a supplied parameter is not expected and ActionController::Parameters.action_on_unpermitted_parameters is set to :raise
.
params = ActionController::Parameters.new(a: "123", b: "456")
params.permit(:c)
# => ActionController::UnpermittedParameters: found unpermitted parameters: a, b
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(params) ⇒ UnpermittedParameters
constructor
:nodoc:.
Constructor Details
#initialize(params) ⇒ UnpermittedParameters
:nodoc:
29 30 31 32 |
# File 'lib/strong_parameters/error.rb', line 29 def initialize(params) # :nodoc: @params = params super("found unpermitted parameter#{'s' if params.size > 1 }: #{params.join(', ')}") end |
Instance Attribute Details
#params ⇒ Object (readonly)
:nodoc:
27 28 29 |
# File 'lib/strong_parameters/error.rb', line 27 def params @params end |