permit!()
Instance Public methods
Sets the permitted
attribute to true
. This can be
used to pass mass assignment. Returns self
.
class Person < ActiveRecord::Base end params = ActionController::Parameters.new(name: 'Francesco') params.permitted? # => false Person.new(params) # => ActiveModel::ForbiddenAttributesError params.permit! params.permitted? # => true Person.new(params) # => #<Person id: nil, name: "Francesco">
Please login to continue.