Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set proper rendered_format when doing render :inline

Closes #5632
  • Loading branch information...
commit 5747e53c92c3fbb52814c3313c489f2a208f685f 1 parent f369f77
@spastorino spastorino authored
View
4 actionpack/lib/action_view/renderer/template_renderer.rb
@@ -11,8 +11,8 @@ def render(context, options)
context = @lookup_context
unless context.rendered_format
- context.rendered_format = template.formats.first
- context.formats = template.formats
+ context.formats = template.formats unless template.formats.empty?
+ context.rendered_format = context.formats.first
end
render_template(template, options[:layout], options[:locals])
View
1  actionpack/test/controller/render_test.rb
@@ -1017,6 +1017,7 @@ def test_accessing_params_in_template
def test_accessing_local_assigns_in_inline_template
get :accessing_local_assigns_in_inline_template, :local_name => "Local David"
assert_equal "Goodbye, Local David", @response.body
+ assert_equal "text/html", @response.content_type
end
def test_should_implicitly_render_html_template_from_xhr_request

0 comments on commit 5747e53

Please sign in to comment.
Something went wrong with that request. Please try again.