Re: Swapping DBs based on subdomains

Chris McGrath
2005-02-28T16:30:50Z

http://wiki.rubyonrails.com/rails/show/HowToUseSubdomainsAsAccountKeys

and

http://wiki.rubyonrails.com/rails/show/HowtoUseMultipleDatabases

Might help you

Chris


On Mon, 28 Feb 2005 11:24:36 -0500, Williams, Chris
<Chris.Williams-yLTBD9Em4aGakBO8gow8eQ@public.gmane.org>
wrote:
>
>
> Hi,
>
>         I''m in a situation where I''d like to share the
exact same DB
> structure, controllers, helpers, models and views between two
"teams". Each
> "team" needs a separate DB that has identical structure but
different data.
>
> So here''s the question: How do I go about setting this up?
I''d like to do it
> by subdomain (but I''ve never even tried to set one up, so
I''m lost), but
> would settle for a field on a User class that I can check when they login
to
> know what team''s DB to use.
>
> Basically the idea is I need multiple production DBs, but would like to
> share common code and structure across them.
>
> Any thoughts?
>
> Thanks,
>  Chris
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>