Module: ActionDispatch::Http::Parameters
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Exceptions:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
::ActionCable::Connection::TestRequest ,
ActionController::TestRequest,
::ActionDispatch::Request ,
::ActionDispatch::TestRequest
| |
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
class_methods | Define class methods from given block. |
included | Evaluate given block in context of base class, so that you can write class macros here. |
prepended | Evaluate given block in context of base class, so that you can write class macros here. |
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 symbols:
{ action: "my_action", controller: "my_controller" }
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 82
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) set_header("action_dispatch.request.parameters", params) params end
#params
Alias for #parameters.
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 63
alias :params :parameters