new(attributes = nil)
Class Public methods
Returns a new instance of ActionController::Parameters
. Also,
sets the permitted
attribute to the default value of
ActionController::Parameters.permit_all_parameters
.
class Person < ActiveRecord::Base end params = ActionController::Parameters.new(name: 'Francesco') params.permitted? # => false Person.new(params) # => ActiveModel::ForbiddenAttributesError ActionController::Parameters.permit_all_parameters = true params = ActionController::Parameters.new(name: 'Francesco') params.permitted? # => true Person.new(params) # => #<Person id: nil, name: "Francesco">
Please login to continue.