123456789_123456789_123456789_123456789_123456789_

Exception: ActionController::UnpermittedParameters

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, IndexError
Instance Chain:
self, IndexError
Inherits: IndexError
  • ::Object
Defined in: actionpack/lib/action_controller/metal/strong_parameters.rb

Overview

Raised when a supplied parameter is not expected and 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

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(params) ⇒ UnpermittedParameters

This method is for internal use only.
[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/strong_parameters.rb', line 62

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 (readonly)

This method is for internal use only.
[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/strong_parameters.rb', line 60

attr_reader :params # :nodoc: