From ed88a601f7b37de0f89b64249aaeed884faed836 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Fri, 28 Feb 2014 19:39:22 -0500 Subject: Do note remove `Content-Type` when `render :body` `render :body` should just not set the `Content-Type` header. By removing the header, it breaks the compatibility with other parts. After this commit, `render :body` will returns `text/html` content type, sets by default from `ActionDispatch::Response`, and it will preserve the overridden content type if you override it. Fixes #14197, #14238 This partially reverts commit 3047376870d4a7adc7ff15c3cb4852e073c8f1da. --- actionview/lib/action_view/helpers/rendering_helper.rb | 5 +++-- actionview/lib/action_view/rendering.rb | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/rendering_helper.rb b/actionview/lib/action_view/helpers/rendering_helper.rb index 15b88bcda6..ebfc35a4c7 100644 --- a/actionview/lib/action_view/helpers/rendering_helper.rb +++ b/actionview/lib/action_view/helpers/rendering_helper.rb @@ -17,8 +17,9 @@ module ActionView # * :html - Renders the html safe string passed in out, otherwise # performs html escape on the string first. Setting the content type as # text/html. - # * :body - Renders the text passed in, and does not set content - # type in the response. + # * :body - Renders the text passed in, and inherits the content + # type of text/html from ActionDispatch::Response + # object. # # If no options hash is passed or :update specified, the default is to render a partial and use the second parameter # as the locals hash. diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb index f96587c816..017302d40f 100644 --- a/actionview/lib/action_view/rendering.rb +++ b/actionview/lib/action_view/rendering.rb @@ -102,11 +102,6 @@ module ActionView # Assign the rendered format to lookup context. def _process_format(format, options = {}) #:nodoc: super - - if options[:body] - self.no_content_type = true - end - lookup_context.formats = [format.to_sym] lookup_context.rendered_format = lookup_context.formats.first end -- cgit v1.2.3