I am trying to convert some subdomain routes from rails 2.3.x (with the subdomain_routes plugin), like these:
map.subdomain :biz do |biz| biz.resources :users biz.resources :projects biz.root :controller => 'home' end
with these routes, I got the following URLs:
http://biz.example.com/users
with rails3, subdomain_routes does not exist, and I cannot create the same routes (even if I read that this is possible). Tried with this:
scope :module => :biz, :as => :biz do constraints(:subdomain => 'biz') do resources :users resources :projects root :to => 'Biz::HomeController#index' end end
but when I try on the console I donβt get a subdomain, so for: app.biz_users_url # http://www.example.com/users , but not http://biz.example.com/users
I also read / watched these resources, but there is no solution to my specific problem:
http://railscasts.com/episodes/221-subdomains-in-rails-3 http://yehudakatz.com/2009/12/26/the-rails-3-router-rack-it-up
any suggestions? thanks in advance;)
but.
Andrea Pavoni
source share