Multisite in Rails 3

I need to develop Rails 3 application with a single codebase
(controlers, models, helpers, etc), but with different views support.
For example if I open my Rails 3 app loads views
and layouts for site1, if I open it loads views and
for site2. So both sites have the same functionality, but looks

What is the best way to implement this functionality in Rails 3.

Thank you in advance.

It shouldn’t be that much different from what you can find at

Also look at
Ramon T.

Depends what you mean by functionality. If all the sites use the same
database, you could for example set up Apache to direct all requests
to the default server and use request.env[‘HTTP_HOST’] to set up a
session variable the layout can use to assign the correct style sheet
or what menus are available or whatever.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs