class ActionController::Parameters
def initialize(parameters = {}, logging_context = {})
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (?Hash parameters, ?Hash logging_context) -> void
This signature was generated using 1 sample from 1 application.
params.permitted? # => true
params = ActionController::Parameters.new(name: "Francesco")
ActionController::Parameters.permit_all_parameters = true
Person.new(params) # => ActiveModel::ForbiddenAttributesError
params.permitted? # => false
params = ActionController::Parameters.new(name: "Francesco")
end
class Person < ActiveRecord::Base
ActionController::Parameters.permit_all_parameters.
Also, sets the +permitted+ attribute to the default value of
Returns a new instance of ActionController::Parameters.
def initialize(parameters = {}, logging_context = {}) @parameters = parameters.with_indifferent_access @logging_context = logging_context @permitted = self.class.permit_all_parameters end