Last active
December 11, 2015 15:19
-
-
Save nicolai86/4620260 to your computer and use it in GitHub Desktop.
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
require 'valid_subdomain' | |
# config/routes | |
Rails::Application.routes.draw do | |
constraints(::ApplicationController::ValidSubdomain) do | |
resource :lol | |
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
# app/controllers/application | |
class ApplicationController | |
class ValidSubdomain | |
def self.matches?(request) | |
return request.subdomain =~ /tacnol/ | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment