diff options
Diffstat (limited to 'actionpack/lib/action_view/renderer/template_renderer.rb')
-rw-r--r-- | actionpack/lib/action_view/renderer/template_renderer.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb index f3abc6d533..82892593f8 100644 --- a/actionpack/lib/action_view/renderer/template_renderer.rb +++ b/actionpack/lib/action_view/renderer/template_renderer.rb @@ -6,7 +6,13 @@ module ActionView @view = context @details = extract_details(options) template = determine_template(options) - freeze_formats(template.formats, true) + context = @lookup_context + + unless context.rendered_format + context.formats = template.formats unless template.formats.empty? + context.rendered_format = context.formats.first + end + render_template(template, options[:layout], options[:locals]) end @@ -29,7 +35,7 @@ module ActionView end end - # Renders the given template. An string representing the layout can be + # Renders the given template. A string representing the layout can be # supplied as well. def render_template(template, layout_name = nil, locals = {}) #:nodoc: view, locals = @view, locals || {} |