aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/rendering.rb
diff options
context:
space:
mode:
authorŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2013-08-02 02:27:28 +0200
committerŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2013-08-25 11:39:13 +0200
commit7d810049fe8905e3e96d0b2e989f562bb961e59e (patch)
treef835d0511c3c1f620307a5779e621e5a9fff988d /actionpack/lib/action_controller/metal/rendering.rb
parent1b1c23599bf0b4c16fec260ed993b27a8cc92724 (diff)
downloadrails-7d810049fe8905e3e96d0b2e989f562bb961e59e.tar.gz
rails-7d810049fe8905e3e96d0b2e989f562bb961e59e.tar.bz2
rails-7d810049fe8905e3e96d0b2e989f562bb961e59e.zip
Add #rendered_format method to controllers
Diffstat (limited to 'actionpack/lib/action_controller/metal/rendering.rb')
-rw-r--r--actionpack/lib/action_controller/metal/rendering.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb
index f0e8945f11..abcc9d4acf 100644
--- a/actionpack/lib/action_controller/metal/rendering.rb
+++ b/actionpack/lib/action_controller/metal/rendering.rb
@@ -10,17 +10,17 @@ module ActionController
# Check for double render errors and set the content_type after rendering.
def render(*args) #:nodoc:
- raise ::AbstractController::DoubleRenderError if response_body
+ raise ::AbstractController::DoubleRenderError if self.response_body
super
- self.content_type ||= Mime[lookup_context.rendered_format].to_s
- response_body
+ self.content_type ||= rendered_format.to_s
+ self.response_body
end
# Overwrite render_to_string because body can now be set to a rack body.
def render_to_string(*)
if self.response_body = super
string = ""
- response_body.each { |r| string << r }
+ self.response_body.each { |r| string << r }
string
end
ensure