diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-31 17:04:15 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-31 17:04:15 +0000 |
commit | 2e1a27fa4de4460808405bdb7771ae2c59b99dd1 (patch) | |
tree | 499655b2ac5a0402045df0bcae2210d10561eeb0 /actionpack/lib/action_controller/response.rb | |
parent | 9a5321fccfa95719732eec664f5d2f25e5e6cde4 (diff) | |
download | rails-2e1a27fa4de4460808405bdb7771ae2c59b99dd1.tar.gz rails-2e1a27fa4de4460808405bdb7771ae2c59b99dd1.tar.bz2 rails-2e1a27fa4de4460808405bdb7771ae2c59b99dd1.zip |
Added second boolean parameter to Base.redirect_to_url and Response#redirect to control whether the redirect is permanent or not (301 vs 302) #375 [Hodel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@293 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/response.rb')
-rwxr-xr-x | actionpack/lib/action_controller/response.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/response.rb b/actionpack/lib/action_controller/response.rb index 836dd5ffef..a574fbca75 100755 --- a/actionpack/lib/action_controller/response.rb +++ b/actionpack/lib/action_controller/response.rb @@ -7,8 +7,8 @@ module ActionController @body, @headers, @session, @assigns = "", DEFAULT_HEADERS.merge("cookie" => []), [], [] end - def redirect(to_url) - @headers["Status"] = "302 Moved" + def redirect(to_url, permanently = false) + @headers["Status"] = permanently ? "301 Moved Permanently" : "302 Found" @headers["location"] = to_url end end |