root/branches/1-2-stable/actionpack/lib/action_controller/deprecated_redirects.rb
| Revision 4079, 0.7 kB (checked in by david, 3 years ago) |
|---|
| Line | |
|---|---|
| 1 | module ActionController |
| 2 | class Base |
| 3 | protected |
| 4 | # Deprecated in favor of calling redirect_to directly with the path. |
| 5 | def redirect_to_path(path) #:nodoc: |
| 6 | redirect_to(path) |
| 7 | end |
| 8 | |
| 9 | # Deprecated in favor of calling redirect_to directly with the url. If the resource has moved permanently, it's possible to pass |
| 10 | # true as the second parameter and the browser will get "301 Moved Permanently" instead of "302 Found". This can also be done through |
| 11 | # just setting the headers["Status"] to "301 Moved Permanently" before using the redirect_to. |
| 12 | def redirect_to_url(url, permanently = false) #:nodoc: |
| 13 | headers["Status"] = "301 Moved Permanently" if permanently |
| 14 | redirect_to(url) |
| 15 | end |
| 16 | end |
| 17 | end |
Note: See TracBrowser for help on using the browser.