aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_controller/components.rb2
-rw-r--r--actionpack/test/controller/components_test.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb
index e6b0194647..5d5a48ebcc 100644
--- a/actionpack/lib/action_controller/components.rb
+++ b/actionpack/lib/action_controller/components.rb
@@ -75,7 +75,7 @@ module ActionController #:nodoc:
# will also use /code/weblog/components as template root
# and find templates in /code/weblog/components/admin/parties/users/
def uses_component_template_root
- path_of_calling_controller = File.dirname(caller[0].split(/:\d+:/, 2).first)
+ path_of_calling_controller = File.dirname(caller[1].split(/:\d+:/, 2).first)
path_of_controller_root = path_of_calling_controller.sub(/#{Regexp.escape(File.dirname(controller_path))}$/, "")
self.template_root = path_of_controller_root
diff --git a/actionpack/test/controller/components_test.rb b/actionpack/test/controller/components_test.rb
index c71de444dc..fbe4637536 100644
--- a/actionpack/test/controller/components_test.rb
+++ b/actionpack/test/controller/components_test.rb
@@ -134,7 +134,8 @@ module A
class NestedController < ActionController::Base
# Stub for uses_component_template_root
def self.caller
- ['./test/fixtures/a/b/c/nested_controller.rb']
+ [ '/path/to/active_support/deprecation.rb:93:in `uses_component_template_root',
+ './test/fixtures/a/b/c/nested_controller.rb' ]
end
end
end