diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-11-20 11:03:21 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-11-20 11:03:21 +0000 |
commit | 6fc8e143c6aafa85c7b392f39a912f2545f23f8d (patch) | |
tree | 162871f66a83ab90c4e6b646d11d0f91311db6a1 /actionpack/lib/action_controller/base.rb | |
parent | 9594832a8dd5631d924c4b45dcae9810e000b057 (diff) | |
download | rails-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-x | actionpack/lib/action_controller/base.rb | 6 |
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: |