aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-11-20 11:03:21 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-11-20 11:03:21 +0000
commit6fc8e143c6aafa85c7b392f39a912f2545f23f8d (patch)
tree162871f66a83ab90c4e6b646d11d0f91311db6a1 /actionpack/lib/action_controller/base.rb
parent9594832a8dd5631d924c4b45dcae9810e000b057 (diff)
downloadrails-6fc8e143c6aafa85c7b392f39a912f2545f23f8d.tar.gz
rails-6fc8e143c6aafa85c7b392f39a912f2545f23f8d.tar.bz2
rails-6fc8e143c6aafa85c7b392f39a912f2545f23f8d.zip
Ensure render_to_string cleans up after itself when an exception is raised. Closes #6658. Great tests!
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5591 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index f477c9d587..9b4b729e8d 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -763,13 +763,11 @@ module ActionController #:nodoc:
# Renders according to the same rules as <tt>render</tt>, but returns the result in a string instead
# of sending it as the response body to the browser.
def render_to_string(options = nil, &block) #:doc:
- result = ActiveSupport::Deprecation.silence { render(options, &block) }
-
+ ActiveSupport::Deprecation.silence { render(options, &block) }
+ ensure
erase_render_results
forget_variables_added_to_assigns
reset_variables_added_to_assigns
-
- result
end
def render_action(action_name, status = nil, with_layout = true) #:nodoc: