aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorNick Sutterer <apotonick@gmail.com>2011-05-03 23:41:38 +0200
committerNick Sutterer <apotonick@gmail.com>2011-05-03 23:41:38 +0200
commit65ceccb0ba13dc845e6c73ada09b354583c1557a (patch)
tree8cb6fbbde0b19fcb00d71acce259741514c33bf5 /actionpack
parent37f448e05e411cb07e829a0d93f6a83ee95ccdf3 (diff)
downloadrails-65ceccb0ba13dc845e6c73ada09b354583c1557a.tar.gz
rails-65ceccb0ba13dc845e6c73ada09b354583c1557a.tar.bz2
rails-65ceccb0ba13dc845e6c73ada09b354583c1557a.zip
controller's prefixes are now added to LookupContext.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/abstract_controller/view_paths.rb7
-rw-r--r--actionpack/test/controller/view_paths_test.rb4
2 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/lib/abstract_controller/view_paths.rb b/actionpack/lib/abstract_controller/view_paths.rb
index cea0f5ad1e..4fdca2cc5c 100644
--- a/actionpack/lib/abstract_controller/view_paths.rb
+++ b/actionpack/lib/abstract_controller/view_paths.rb
@@ -15,7 +15,10 @@ module AbstractController
# templates, i.e. view paths and details. Check ActionView::LookupContext for more
# information.
def lookup_context
- @lookup_context ||= ActionView::LookupContext.new(self.class._view_paths, details_for_lookup)
+ @lookup_context ||=
+ ActionView::LookupContext.new(self.class._view_paths, details_for_lookup).tap do |ctx|
+ ctx.prefixes = _prefixes
+ end
end
def details_for_lookup
@@ -67,4 +70,4 @@ module AbstractController
end
end
end
-end \ No newline at end of file
+end
diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb
index 42356be1ea..3de1849db8 100644
--- a/actionpack/test/controller/view_paths_test.rb
+++ b/actionpack/test/controller/view_paths_test.rb
@@ -179,4 +179,8 @@ class ViewLoadPathsTest < ActionController::TestCase
assert_nothing_raised { C.append_view_path 'c/path' }
assert_paths C, "c/path"
end
+
+ def test_lookup_context_accessor
+ assert_equal ["test"], TestController.new.lookup_context.prefixes
+ end
end