instance method
parameter_parsers=
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
parameter_parsers=(parsers)
Configure the parameter parser for a given MIME type.
It accepts a hash where the key is the symbol of the MIME type and the value is a proc.
original_parsers = ActionDispatch::Request.parameter_parsers xml_parser = -> (raw_post) { Hash.from_xml(raw_post) || {} } new_parsers = original_parsers.merge(xml: xml_parser) ActionDispatch::Request.parameter_parsers = new_parsers
Parameters
-
parsersreq
Source
# File actionpack/lib/action_dispatch/http/parameters.rb, line 46
def parameter_parsers=(parsers)
@parameter_parsers = parsers.transform_keys { |key| key.respond_to?(:symbol) ? key.symbol : key }
end
Defined in actionpack/lib/action_dispatch/http/parameters.rb line 46
· View on GitHub
· Improve this page
· Find usages on GitHub