Permalink
Browse files

Just change the formats on first render, closes #5307, closes #5308.

  • Loading branch information...
1 parent 74fe7e1 commit bcea8cd6d62f73cebc88256f7f54430c16f1b89d @josevalim josevalim committed Mar 7, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 actionpack/lib/action_view/renderer/template_renderer.rb
@@ -8,8 +8,13 @@ def render(context, options)
@details = extract_details(options)
extract_format(options[:file] || options[:template], @details)
template = determine_template(options)
- @lookup_context.rendered_format ||= template.formats.first
- @lookup_context.formats = template.formats
+ context = @lookup_context
+
+ unless context.rendered_format
+ context.rendered_format = template.formats.first
+ context.formats = template.formats
+ end
+
render_template(template, options[:layout], options[:locals])
end

0 comments on commit bcea8cd

Please sign in to comment.