Permalink
Browse files

Add a catch-all eraser

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1918 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 4f40b2d commit e9cfe955cc2aea23f197db8e72595857f8384737 @dhh dhh committed Jul 25, 2005
Showing with 7 additions and 2 deletions.
  1. +7 −2 actionpack/lib/action_controller/base.rb
@@ -673,7 +673,7 @@ def render_without_layout(template_name = default_template_name, status = nil)
# 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,14 +682,19 @@ def erase_render_results #: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
response.headers['Status'] = DEFAULT_RENDER_STATUS_CODE
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)

0 comments on commit e9cfe95

Please sign in to comment.