From 6fc8e143c6aafa85c7b392f39a912f2545f23f8d Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 20 Nov 2006 11:03:21 +0000 Subject: 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 --- actionpack/lib/action_controller/base.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_controller') 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 render, 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: -- cgit v1.2.3