Last active
August 29, 2015 14:22
-
-
Save traviskroberts/739001cc5a3274f3da03 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
class Domain | |
def self.matches?(request) | |
request.domain.present? && request.domain != 'example.com' | |
end | |
end |
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
MyApp::Application.routes.draw do | |
# domain routes (THIS IS THE IMPORTANT PART) | |
constraints(Domain) do | |
match '/' => 'user#show', :as => :user_domain | |
resources :tasks | |
resources :projects | |
# any other routes that are domain-specific | |
end | |
# this needs to be below the "domain" section | |
root :to => 'site#index' | |
end |
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
<VirtualHost *:80> | |
DocumentRoot /path/to/my_app/public | |
<Directory /path/to/my_app/public> | |
Options FollowSymLinks | |
AllowOverride None | |
Order allow,deny | |
Allow from all | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment