Created
May 3, 2012 19:59
-
-
Save lukewendling/2588837 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ApplicationController | |
# perhaps in a mixin | |
def permanent_redirect_to(options) | |
url = case options | |
when String | |
options | |
else | |
url_for(options) | |
end | |
head :moved_permanently, :location => url | |
end | |
end | |
def StaticPagesController < ApplicationController | |
def obsolete_page | |
permanent_redirect_to new_page_url | |
# or, permanent_redirect_to 'url_string' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment