From 3b8395a8825962b7ddbcb43a24334e5a5994ffde Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 26 Aug 2015 15:31:23 -0700 Subject: only call self.content_type= when there is a response Apparently the AbstractController (whatever "abstract" means) is expected to work without a request and response. --- actionpack/lib/action_controller/metal/rendering.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 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 a2d671486d..c8934b367f 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -56,10 +56,12 @@ module ActionController nil end - def _process_format(format) - super + def _get_content_type(rendered_format) + self.content_type || super + end - self.content_type ||= format.to_s + def _set_content_type(format) + self.content_type = format end # Normalize arguments by catching blocks and setting them on :update. -- cgit v1.2.3