aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-25 08:49:19 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-25 08:49:19 +0000
commite9cfe955cc2aea23f197db8e72595857f8384737 (patch)
tree3009a0d387d3c0041796e763f3c86771a2426f96
parent4f40b2d8fbcfb437a628a353eb281553fc840728 (diff)
downloadrails-e9cfe955cc2aea23f197db8e72595857f8384737.tar.gz
rails-e9cfe955cc2aea23f197db8e72595857f8384737.tar.bz2
rails-e9cfe955cc2aea23f197db8e72595857f8384737.zip
Add a catch-all eraser
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1918 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rwxr-xr-xactionpack/lib/action_controller/base.rb9
1 files 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)