aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/components.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/components.rb')
-rw-r--r--actionpack/lib/action_controller/components.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb
index c05b1eb068..0515461910 100644
--- a/actionpack/lib/action_controller/components.rb
+++ b/actionpack/lib/action_controller/components.rb
@@ -139,22 +139,22 @@ module ActionController #:nodoc:
self.class
end
end
-
+
# 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
def request_for_component(controller_name, options)
- request = @request.dup
- request.session = @request.session
-
- request.instance_variable_set(
+ 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]
)
)
-
- request
+
+ new_request
end
def component_logging(options)