On Dec 15, 2007, at 1:54 AM, Tim Uckun wrote:

>> Maybe I'm missing something, but it sounds like Rails would work  
>> great
>> for your situation.
>>
>
>
> If rails can work for me I don't quite know how to do it.  Let me  
> explain.
>
> I am about to start a project which will involve creating several web
> sites.  These will be completely different web sites but for the same
> company and using the same database.
>
> I can already forsee that I want to share many (but not all) of the
> models between the web sites as well as sharing some of the
> controllers.
>
> I am not sure how the views situation will work itself out yet but to
> start with I would like to set a "master" template that every web site
> uses and override individual sections and content using partials.
>
>
> Ideally it would be a kind of a hierarchy where I had a /websites
> directory with each rails app living underneath it. If I called for a
> model it would look in /websites/myapp/app/models and then look up
> /websites/shared/models if it could not find it.  Same with
> controllers, views etc.
>
> It would also be nice to use same mongrel pool for all the web sites.
>
>
> I  hate to say it but something sort-of-kind-of-but-not-really-zope.
>
It should be doable, but you'll have to brew up some way to negotiate  
a default route for each distinct site.
you should be able to reuse controllers to some extent.
Most of the trick here should be the routes and the controllers.
Sharing the same database should be no problem.

The other approach would be to build up a a simple version that  
contains the shared functionality, then make 2 branches that add the  
functionality unique to each one.
They can still share the same database, but if you're using MySQL you  
might as well just give them access to eachother's databases and have  
them send RESTful messages to eachother at a Ruby/Rails level. If too  
many different apps are running on the same database, you might run  
into some kind of race condition issues at the database level with  
competition for accessing/changing shared table data. The whole idea  
of ActiveRecord is to simplify the database side of things as much as  
possible.