From 4aabe46341dd6db9bf9bbbbc27c32f467a7c55b7 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Tue, 9 Oct 2007 23:07:36 +0000 Subject: Add :status to redirect_to allowing users to choose their own response code without manually setting headers. Closes #8297 [codahale, chasgrundy] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7820 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/response.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_controller/response.rb') diff --git a/actionpack/lib/action_controller/response.rb b/actionpack/lib/action_controller/response.rb index 84edafd7bf..1d9f6676ba 100755 --- a/actionpack/lib/action_controller/response.rb +++ b/actionpack/lib/action_controller/response.rb @@ -28,8 +28,8 @@ module ActionController charset.blank? ? nil : charset.strip.split("=")[1] end - def redirect(to_url, permanently = false) - self.headers["Status"] = "302 Found" unless headers["Status"] == "301 Moved Permanently" + def redirect(to_url, response_status) + self.headers["Status"] = response_status self.headers["Location"] = to_url self.body = "You are being redirected." -- cgit v1.2.3