Permalink
Browse files

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

  • Loading branch information...
1 parent e6e591d commit bbdb54ad153673a2733e109709f666bede1c61ac @josevalim josevalim committed Mar 7, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 actionpack/lib/action_view/renderer/template_renderer.rb
@@ -6,8 +6,13 @@ def render(context, options)
@view = context
@details = extract_details(options)
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 bbdb54a

Please sign in to comment.