private Method

InstanceMethods.request_for_component(controller_name, options)

Create a new request object based on the current request. The new request inherits the session from the current request, bypassing any session options set for the component controller’s class

Source Code

# File action_controller/components.rb, line 131
def request_for_component(controller_name, options)
  new_request         = request.dup
  new_request.session = request.session

  new_request.instance_variable_set(
    :@parameters,
    (options[:params] || {}).with_indifferent_access.update(
      "controller" => controller_name, "action" => options[:action], "id" => options[:id]
    )
  )

  new_request
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.