From e9cfe955cc2aea23f197db8e72595857f8384737 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 25 Jul 2005 08:49:19 +0000 Subject: Add a catch-all eraser git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1918 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/base.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 995edfd9e6..0e8dcb6d1b 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -673,7 +673,7 @@ module ActionController #:nodoc: # Clears the rendered results, allowing for another render to be performed. - def erase_render_results #:nodoc: + def erase_render_results @response.body = nil @performed_render = false end @@ -682,7 +682,7 @@ module ActionController #:nodoc: # the URL that was used to redirect or nil if there was no redirected URL # Note that +redirect_to+ will change the body of the response to indicate a redirection. # The response body is not reset here, see +erase_render_results+ - def erase_redirect_results #:nodoc: + def erase_redirect_results @performed_redirect = false response.redirected_to = nil response.redirected_to_method_params = nil @@ -690,6 +690,11 @@ module ActionController #:nodoc: response.headers.delete('location') end + # Erase both render and redirect results + def erase_results + erase_render_results + erase_redirect_results + end def rewrite_options(options) if defaults = default_url_options(options) -- cgit v1.2.3