提交 cb6d94cc 编写于 作者: J Jeremy Kemper

Deprecation: remove deprecated redirect methods.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6400 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 83c8db98
*SVN*
* Deprecation: remove deprecated instance variables. [Jeremy Kemper]
* Deprecation: remove deprecated instance variables and redirect methods. [Jeremy Kemper]
* Consistent public/protected/private visibility for chained methods. #7813 [Dan Manges]
......
......@@ -37,7 +37,6 @@
$:.unshift "#{File.dirname(__FILE__)}/action_controller/vendor/html-scanner"
require 'action_controller/base'
require 'action_controller/deprecated_redirects'
require 'action_controller/request'
require 'action_controller/deprecated_request_methods'
require 'action_controller/rescue'
......
module ActionController
class Base
protected
# Deprecated in favor of calling redirect_to directly with the path.
def redirect_to_path(path) #:nodoc:
redirect_to(path)
end
# Deprecated in favor of calling redirect_to directly with the url. If the resource has moved permanently, it's possible to pass
# true as the second parameter and the browser will get "301 Moved Permanently" instead of "302 Found". This can also be done through
# just setting the headers["Status"] to "301 Moved Permanently" before using the redirect_to.
def redirect_to_url(url, permanently = false) #:nodoc:
headers["Status"] = "301 Moved Permanently" if permanently
redirect_to(url)
end
end
end
......@@ -24,7 +24,7 @@ def redirect_to_path() redirect_to '/some/path' end
def redirect_to_named_route() redirect_to route_one_url end
# a redirect to an external location
def redirect_external() redirect_to_url "http://www.rubyonrails.org"; end
def redirect_external() redirect_to "http://www.rubyonrails.org"; end
# a 404
def response404() head '404 AWOL' end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册