Exception: ActionController::UnpermittedParameters
- Inherits:
-
IndexError
- Object
- IndexError
- ActionController::UnpermittedParameters
- Defined in:
- lib/action_controller/metal/strong_parameters.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:
49 50 51 52 |
# File 'lib/action_controller/metal/strong_parameters.rb', line 49 def initialize(params) # :nodoc: @params = params super("found unpermitted parameter#{'s' if params.size > 1 }: #{params.map { |e| ":#{e}" }.join(", ")}") end |
Instance Attribute Details
#params ⇒ Object (readonly)
:nodoc:
47 48 49 |
# File 'lib/action_controller/metal/strong_parameters.rb', line 47 def params @params end |