123456789_123456789_123456789_123456789_123456789_

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:
Defined in: actionpack/lib/action_dispatch/http/parameters.rb

Constant Summary

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

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'}
[ GitHub ]

  
# 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.

[ GitHub ]

  
# 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.

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/http/parameters.rb', line 63

alias :params :parameters