mbleigh / subdomain-fu

A new plugin approach to attempting to solve the usage of subdomains in linking and routing in Rails projects.
http://rdoc.info/projects/mbleigh/subdomain-fu
Other
586 stars 118 forks source link

map.with_options root controller #4

Open f10i opened 14 years ago

f10i commented 14 years ago

Hello, I defined the following route:

map.with_options :conditions => {:subdomain => 'foo'} do |bar| bar.resources :users end

How can I define a root route for this subdomain? so that if anybody visits foo.example.com, they'll be automatically redirected to that controller?

I tried the following two rules with no luck: 1) bar.root :controller => 'abc' 2) bar.connect '/', :controller => 'abc'

Any ideas?

ogennadi commented 13 years ago

Hey, I'm having the same problem, too, but on rails 3. Did you ever figure out a solution?

f10i commented 13 years ago

IIRC, I solved it with the following route:

bar.connect '', :controller => 'abc'