Rails route based on virtual host (Host HTTP header)

Is it possible to specify a Ruby on Rails route based on the host part of the request URL?

In config/routes.rb, I have

root :to => 'entities#index'

but I would like to use the same code base to serve several sites, each with their own default controller.

5
задан Eero 15 May 2011 в 13:57
поделиться