Flowdock
method

permit!

Importance_1
Ruby on Rails latest stable (v4.2.1) - 0 notes - Class: Parameters
permit!() public

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">
Show source
Register or log in to add new notes.