Created
August 21, 2008 22:10
-
-
Save carllerche/6656 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
Merb::Router.prepare do |r| | |
r.domain("admin-domain.com", :controller_prefix => :admin) do |admin| | |
admin.resources :users | |
end | |
r.domain("content.com", :controller_prefix => :site) do |site| | |
site.resources :users | |
end | |
end | |
# when on admin-domain.com and url(:admin_users) => /users | |
# when on content.com and url(:admin_users) => http://admin-domain.com/users | |
# ---- | |
Merb::Router.prepare do |r| | |
r.domain(":account.saas.com") do |saas| | |
# Here there is no controller namespace | |
saas.resources :users # This has the :account set | |
end | |
end | |
# when on foo.saas.com and url(:users, :account => "foo") => /users | |
# when on bar.saas.com and url(:users, :account => "foo") => http://foo.saas.com/users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment