Exception: ActionController::UnpermittedParameters

Inherits:
IndexError
  • Object
show all
Defined in:
lib/action_controller/metal/strong_parameters.rb

Overview

Raised when a supplied parameter is not expected.

params = ActionController::Parameters.new(a: "123", b: "456")
params.permit(:c)
# => ActionController::UnpermittedParameters: found unexpected keys: a, b

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ UnpermittedParameters

:nodoc:


32
33
34
35
# File 'lib/action_controller/metal/strong_parameters.rb', line 32

def initialize(params) # :nodoc:
  @params = params
  super("found unpermitted parameters: #{params.join(", ")}")
end

Instance Attribute Details

#paramsObject (readonly)

:nodoc:


30
31
32
# File 'lib/action_controller/metal/strong_parameters.rb', line 30

def params
  @params
end