I would like to access one rails application through more virtual hosts. The different virtual hosts would differ in the database, images, stylesheets and in some cases the layout of the views. What do you recommend for realisation of serving multiple applications by one rails code, which is accessed through different virtual hosts?
Edited
To specify what I imagine better, I add these:
- I prefer rails to distinguish which db/styles/images/layouts have to use based on the host name.
- There may be different rails applications running, but above the same code.
- Db connections might be established during the application initiation.
I am wondering which layer the rails app should recognise the host? Should it be on the middleware, in boot scripts or elsewhere?