Rails: Routing subdomain to a resource
问题 Is it possible to map a subdomain to a resource? I have a company model. Currently, using subdomain_fu, my routing file contains: map.company_root '', :controller => 'companies', :action => 'show', :conditions => { :subdomain => /.+/ } My Company model contains a "subdomain" column. Whilst this works as intended, it's a named route and isn't restful. Essentially, I need to map "name.domain.com" to the show action for the companies controller. Is a named route the way to go, or can I use a