Permalink
Browse files

Also allow prefixes as third argument to lookup context.

  • Loading branch information...
1 parent 4758d37 commit c9fa3f03fee1b3a191fa64ec4e31b1f84b66e9d7 @josevalim josevalim committed May 4, 2011
@@ -16,9 +16,7 @@ module ViewPaths
# information.
def lookup_context
@lookup_context ||=
- ActionView::LookupContext.new(self.class._view_paths, details_for_lookup).tap do |ctx|
- ctx.prefixes = _prefixes
- end
+ ActionView::LookupContext.new(self.class._view_paths, details_for_lookup, _prefixes)
end
def details_for_lookup
@@ -60,11 +60,11 @@ def initialize
end
end
- def initialize(view_paths, details = {})
+ def initialize(view_paths, details = {}, prefixes = [])
@details, @details_key = { :handlers => default_handlers }, nil
@frozen_formats, @skip_default_locale = false, false
@cache = true
- @prefixes = []
+ @prefixes = prefixes
self.view_paths = view_paths
self.registered_detail_setters.each do |key, setter|
@@ -20,7 +20,7 @@ def determine_template(options) #:nodoc:
if options.key?(:text)
Template::Text.new(options[:text], formats.try(:first))
elsif options.key?(:file)
- with_fallbacks { find_template(options[:file], options[:prefixes], false, keys) }
+ with_fallbacks { find_template(options[:file], nil, false, keys) }
elsif options.key?(:inline)
handler = Template.handler_for_extension(options[:type] || "erb")
Template.new(options[:inline], "inline template", handler, :locals => keys)

0 comments on commit c9fa3f0

Please sign in to comment.