Permalink
Browse files

controller's prefixes are now added to LookupContext.

  • Loading branch information...
1 parent 37f448e commit 65ceccb0ba13dc845e6c73ada09b354583c1557a @apotonick apotonick committed May 3, 2011
@@ -15,7 +15,10 @@ module ViewPaths
# 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 @@ def view_paths=(paths)
end
end
end
-end
+end
@@ -179,4 +179,8 @@ class C < ActionController::Base; end
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

0 comments on commit 65ceccb

Please sign in to comment.