Exception: ActionController::UnpermittedParameters

Inherits:
IndexError
  • Object
show all
Defined in:
actionpack/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:



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

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

Instance Attribute Details

#paramsObject (readonly)

:nodoc:



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

def params
  @params
end