Exception: ActiveModel::ForbiddenAttributesError
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
StandardError
|
|
|
Instance Chain:
self,
StandardError
|
|
| Inherits: |
StandardError
|
| Defined in: | activemodel/lib/active_model/forbidden_attributes_protection.rb |
Overview
=======================================
Raised when forbidden attributes are used for mass assignment.
class Person < {ActiveRecord::Base}
end
params = {ActionController::Parameters.new}(name: 'Bob')
{Person.new}(params)
### => <code>ForbiddenAttributesError</code>
params.permit!
{Person.new}(params)
### => {#<}Person id: nil, name: "Bob">