Skip to content

Commit

Permalink
Just change the formats on first render, closes rails#5307, closes ra…
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Mar 7, 2012
1 parent 74fe7e1 commit bcea8cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions actionpack/lib/action_view/renderer/template_renderer.rb
Expand Up @@ -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

Expand Down

0 comments on commit bcea8cd

Please sign in to comment.