Created
July 16, 2013 13:50
-
-
Save josiasds/6008882 to your computer and use it in GitHub Desktop.
Subdomain routes for multiple controllers
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 | |
resources :agents do | |
resources :brands, module: 'agents' | |
end | |
get '/', to: 'agents/brands#show', constraints: lambda { |r| r.subdomain.present? && r.subdomain != 'www' } | |
get '/', to: 'agents#show', constraints: lambda { |r| r.subdomain.present? && r.subdomain != 'www' } | |
root 'home#index' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment