aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/renderer/abstract_renderer.rb13
-rw-r--r--actionpack/lib/action_view/renderer/template_renderer.rb2
2 files changed, 13 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderer/abstract_renderer.rb b/actionpack/lib/action_view/renderer/abstract_renderer.rb
index 1656cf7ec7..03feeff16c 100644
--- a/actionpack/lib/action_view/renderer/abstract_renderer.rb
+++ b/actionpack/lib/action_view/renderer/abstract_renderer.rb
@@ -12,7 +12,18 @@ module ActionView
end
protected
-
+
+ def extract_details(options)
+ details = {}
+ @lookup_context.registered_details.each do |key|
+ next unless value = options[key]
+ details[key] = Array.wrap(value)
+ end
+ details
+ end
+
+
+
def extract_format(value, details)
if value.is_a?(String) && value.sub!(formats_regexp, "")
ActiveSupport::Deprecation.warn "Passing the format in the template name is deprecated. " \
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb
index f3e7378f2b..ac91d333ba 100644
--- a/actionpack/lib/action_view/renderer/template_renderer.rb
+++ b/actionpack/lib/action_view/renderer/template_renderer.rb
@@ -5,7 +5,7 @@ module ActionView
class TemplateRenderer < AbstractRenderer #:nodoc:
def render(context, options)
@view = context
- @details = options.slice(:formats, :locale, :handlers)
+ @details = extract_details(options)
extract_format(options[:file] || options[:template], @details)
template = determine_template(options)
freeze_formats(template.formats, true)