Created
December 6, 2012 05:01
-
-
Save midas/4221918 to your computer and use it in GitHub Desktop.
Rails router constraints
This file contains hidden or 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
class AppSubdomain | |
def self.matches?( request ) | |
request.subdomain == 'app' | |
end | |
end |
This file contains hidden or 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
class MarketingSubdomain | |
def self.matches?( request ) | |
request.subdomain.blank? || request.subdomain == 'www' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment