From 2de60a926b541d837d7a927bb2efc8135679ac40 Mon Sep 17 00:00:00 2001 From: akihiro17 Date: Thu, 27 Aug 2015 14:05:47 +0900 Subject: Set the content-type to `text/html` if the options[:html] is true In this commit, we set the content-type to `text/html` in AbstractController if the `options[:html]` is true so that we don't include ActionView::Rendering into ActionController::Metal to set it properly. I removed the if `options[:plain]` statement because `AbstractController#rendered_format` returns `Mime::TEXT` by default. --- actionpack/lib/abstract_controller/rendering.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 2bb7c2139e..6db0941b52 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -23,8 +23,8 @@ module AbstractController def render(*args, &block) options = _normalize_render(*args, &block) self.response_body = render_to_body(options) - if options[:plain] - _set_content_type Mime::TEXT.to_s + if options[:html] + _set_content_type Mime::HTML.to_s else _set_content_type _get_content_type(rendered_format) end -- cgit v1.2.3