aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/redirector.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@yehuda-katzs-macbookpro41.local>2009-05-27 10:40:43 +0200
committerYehuda Katz <wycats@yehuda-katzs-macbookpro41.local>2009-05-27 10:40:43 +0200
commit6bbe965ccdcef2d7e713e65175722718d325b2bd (patch)
tree5c9fc1d58b3f9ef692a356c49638d78611a51948 /actionpack/lib/action_controller/new_base/redirector.rb
parent311d686d031bbc7074bddd8d56ea42780a204b35 (diff)
downloadrails-6bbe965ccdcef2d7e713e65175722718d325b2bd.tar.gz
rails-6bbe965ccdcef2d7e713e65175722718d325b2bd.tar.bz2
rails-6bbe965ccdcef2d7e713e65175722718d325b2bd.zip
Reduce the cost of using ActionController::Http significantly by:
* Removing the dependency on AD::Request and AD::Response * Moving the logic for the request and response object into a new module that is included by default. * Changing Renderer and Redirector to use self.headers, self.content_type, and self.status, which have very basic default implementations on AC::Http. When RackConvenience is included (which it is by default on AC::Base), the full Request/Response logic is used instead of the simple logic.
Diffstat (limited to 'actionpack/lib/action_controller/new_base/redirector.rb')
-rw-r--r--actionpack/lib/action_controller/new_base/redirector.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/new_base/redirector.rb b/actionpack/lib/action_controller/new_base/redirector.rb
index ff7b74341c..b2da412edf 100644
--- a/actionpack/lib/action_controller/new_base/redirector.rb
+++ b/actionpack/lib/action_controller/new_base/redirector.rb
@@ -11,8 +11,8 @@ module ActionController
def redirect_to(url, status) #:doc:
raise AbstractController::DoubleRenderError if response_body
logger.info("Redirected to #{url}") if logger && logger.info?
- response.status = status
- response.location = url.gsub(/[\r\n]/, '')
+ self.status = status
+ self.location = url.gsub(/[\r\n]/, '')
self.response_body = "<html><body>You are being <a href=\"#{CGI.escapeHTML(url)}\">redirected</a>.</body></html>"
end
end