You could also use the router to get the domain or subdomain:

match(:subdomains => /(.*)/).
to(:account => ":subdomains[1]") do
  resources :articles
end

Then override the _template_location to set the view path.

Matthijs approach is really nice too, I'd like to see pros and crons for
each one.

A demo app would be nice. I will upload later a simple app I was playing
with.

Peter.


On Fri, Nov 21, 2008 at 6:42 AM, Mark Watson <[EMAIL PROTECTED]> wrote:

>
> Good idea Matthijs.
>
> You can also use nginx and map different URL patterns of the same merb
> web app to different domains; for example:
>
> http://mydomain.com/test1 --> http://test1.com
> http://mydomain.com/test2 --> http://test2.com
> http://mydomain.com/test3 --> http://test3.com
>
> Just as with Matthijs' suggestion, all domains share same models and
> data.
>
> On Nov 21, 7:09 am, "Matthijs Langenberg" <[EMAIL PROTECTED]>
> wrote:
> > I've an app that uses the HTTP_HOST header from the request to query a
> site
> > from the database and set the view path to /themes/{site_id} per request.
> So
> > that's how I've created a multisite app.
> >
> > On Fri, Nov 21, 2008 at 9:26 AM, Redd Vinylene <[EMAIL PROTECTED]
> >wrote:
> >
> >
> >
> > > On Fri, Nov 21, 2008 at 6:24 AM, bergstyle <[EMAIL PROTECTED]>
> wrote:
> >
> > > > anybody have strategies for serving multiple sites from one merb
> > > > application? my goal is to share my models and data store across a
> > > > number of sites and have one backend to manage them all. each site
> > > > will have it's own layout, views and controllers.
> >
> > > > the end result will be a bunch of niche e-commerce sites managed by
> > > > one admin interface.
> >
> > > I've long wanted the same thing. Perhaps we could get together and
> > > make a demo app?
> >
> > > --
> > >http://www.home.no/reddvinylene
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to