From cd8eb351fb514a0e7225cb548e5eec082a0b495e Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 8 Sep 2015 14:57:33 -0700 Subject: push content_type assigment in to metal everything above metal really doesn't care about setting the content type, so lets rearrange these methods to be in metal. --- actionpack/lib/action_controller/metal/rendering.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_controller/metal/rendering.rb') diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index 363d45c722..4214399b6f 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -56,12 +56,14 @@ module ActionController nil end - def _get_content_type(rendered_format) - self.content_type || rendered_format.to_s + def _set_html_content_type + self.content_type = Mime::HTML.to_s end - def _set_content_type(format) - self.content_type = format + def _set_rendered_content_type(format) + unless response.content_type + self.content_type = format.to_s + end end # Normalize arguments by catching blocks and setting them on :update. -- cgit v1.2.3