0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ForbiddenAttributesError

Posted at

禁じられた属性のエラー

Active Model ForbiddenAttributesError

マスアサインメントに使われた禁じられた属性のとき例外が起きる

Raised when forbidden attributes are used for mass assignment.

class Person < ActiveRecord::Base
end

params = 

ActionController::Parameters.new(name: 'Bob')
Person.new(params)
# => ActiveModel::ForbiddenAttributesError

params.permit!
Person.new(params)
# => #<Person id: nil, name: "Bob"

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?