Skip to content

Instantly share code, notes, and snippets.

@carllerche
Created August 15, 2008 07:12
Show Gist options
  • Save carllerche/5549 to your computer and use it in GitHub Desktop.
Save carllerche/5549 to your computer and use it in GitHub Desktop.
Merb::Router.prepare do |r|
r.domain(":account.domain.com") do |account|
r.resources :users
end
end
# currently on foo.domain.com
url(:users, :account => "foo") # => /users
# currently on bar.domain.com
url(:users, :account => "foo") # => http://foo.domain.com/users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment