Module: ActionDispatch::Http::Parameters
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Exceptions:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::ActiveSupport::Concern
|
|
Defined in: | actionpack/lib/action_dispatch/http/parameters.rb |
Constant Summary
-
DEFAULT_PARSERS =
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 10{ Mime[:json].symbol => -> (raw_post) { data = ActiveSupport::JSON.decode(raw_post) data.is_a?(Hash) ? data : { _json: data } } }
-
PARAMETERS_KEY =
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 8"action_dispatch.request.path_parameters"
Class Method Summary
::ActiveSupport::Concern
- Extended
Instance Attribute Summary
-
#path_parameters
rw
Returns a hash with the parameters used to form the path of the request.
Instance Method Summary
-
#parameters
(also: #params)
Returns both GET and POST parameters in a single hash.
-
#params
Alias for #parameters.
DSL Calls
included
[ GitHub ]25 26 27 28 29 30 31 32
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 25
included do class << self # Returns the parameter parsers. attr_reader :parameter_parsers end self.parameter_parsers = DEFAULT_PARSERS end
Instance Attribute Details
#path_parameters (rw)
Returns a hash with the parameters used to form the path of the request. Returned hash keys are strings:
{'action' => 'my_action', 'controller' => 'my_controller'}
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 83
def path_parameters get_header(PARAMETERS_KEY) || set_header(PARAMETERS_KEY, {}) end
Instance Method Details
#parameters Also known as: #params
Returns both GET and POST parameters in a single hash.
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 50
def parameters params = get_header("action_dispatch.request.parameters") return params if params params = begin request_parameters.merge(query_parameters) rescue EOFError query_parameters.dup end params.merge!(path_parameters) params = set_binary_encoding(params, params[:controller], params[:action]) set_header("action_dispatch.request.parameters", params) params end
#params
Alias for #parameters.
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 64
alias :params :parameters