aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/deprecated_redirects.rb
blob: 3e18aeab406d21b067f7e113a71ffb5eef9e9d0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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