diff --git a/actionpack/lib/abstract_controller/view_paths.rb b/actionpack/lib/abstract_controller/view_paths.rb index 4fdca2cc5c327f69daae0c9cdae9dc4abb2b01a6..a777cf866d6d0626ee2314a40823696321cdfa1f 100644 --- a/actionpack/lib/abstract_controller/view_paths.rb +++ b/actionpack/lib/abstract_controller/view_paths.rb @@ -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 diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb index 797a55b2b6d25dd1d82179929ce25a1a45a61dd5..06975ffa2f3eb4c02b115e3b51096d7b4d216504 100644 --- a/actionpack/lib/action_view/lookup_context.rb +++ b/actionpack/lib/action_view/lookup_context.rb @@ -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| diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb index 6c55a865a115c58ff2f85c404da6ed925a2ccad5..a09cef8fefdadaca6ab0c00d807233a4a57bb4f6 100644 --- a/actionpack/lib/action_view/renderer/template_renderer.rb +++ b/actionpack/lib/action_view/renderer/template_renderer.rb @@ -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)