Our app dynamically publishes multiple sites for multiple clients but the urls they need are vastly different and I was wondering if rails routes could handle them dynamically somehow Right now we have a unique site_code for each site and the site controllers live in a sites folder so the urls are application.com/SITE_CODE/sites/controller/action/id The admin interface is application.com/admin/controller/action/id How would we get the site urls to map to combinations like: http://poweredby.jobsgopublic.com/employername http://www.surreyjobs.info http://jobs.lewisham.gov.uk http://www.jobsgopublic.com/telegraph http://police.jobsgopublic.com/ -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 5/3/07, Levent Ali <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Our app dynamically publishes multiple sites for multiple clients but > the urls they need are vastly different and I was wondering if rails > routes could handle them dynamically somehow > > Right now we have a unique site_code for each site and the site > controllers live in a sites folder so the urls are > > application.com/SITE_CODE/sites/controller/action/id > > The admin interface is > application.com/admin/controller/action/id > > How would we get the site urls to map to combinations like: > > http://poweredby.jobsgopublic.com/employername > > http://www.surreyjobs.info > > http://jobs.lewisham.gov.uk > > http://www.jobsgopublic.com/telegraph > > http://police.jobsgopublic.com/Nope, rails doesn''t handle this. This is not a standard setup for applications, so you''ll have to write some custom code. My publishing system Mephisto does something similar, however. Domains map to sites (www.rubyonrails.org, weblog.rubyonrails.org, and prototypejs.org all run on the same mongrel cluster). I use a catch-all route to handle custom paths that renders the public content. Here''s a real simplified routes file: # add admin routes first map.admin ''admin'', :controller => ''admin/overview'', :action => ''index'' # put this at the bottom, it sends custom paths to this controller/action map.connect ''*path'', :controller => ''mephisto'', :action => ''dispatch'' -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve managed something similar to what you''re describing by using Jamis Buck''s routing_tricks plugin [ http://weblog.jamisbuck.org/2006/10/26/monkey-patching-rails-extending-routes-2]. I''m serving up multiple sites from the same app and each site served has its own routing. RSL On 5/3/07, Levent Ali <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Our app dynamically publishes multiple sites for multiple clients but > the urls they need are vastly different and I was wondering if rails > routes could handle them dynamically somehow > > Right now we have a unique site_code for each site and the site > controllers live in a sites folder so the urls are > > application.com/SITE_CODE/sites/controller/action/id > > The admin interface is > application.com/admin/controller/action/id > > How would we get the site urls to map to combinations like: > > http://poweredby.jobsgopublic.com/employername > > http://www.surreyjobs.info > > http://jobs.lewisham.gov.uk > > http://www.jobsgopublic.com/telegraph > > http://police.jobsgopublic.com/ > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Russell Norris wrote:> I''ve managed something similar to what you''re describing by using Jamis > Buck''s routing_tricks plugin [ > http://weblog.jamisbuck.org/2006/10/26/monkey-patching-rails-extending-routes-2]. > I''m serving up multiple sites from the same app and each site served has > its > own routing. > > RSLcheers guys... I''ll look into the Mephisto codebase as well as Jamis Buck''s post right away... I also found http://leflo.de/blog/2007/04/05/literal-urls-with-rails which may be useful also... regards levent ps: Rick... Thanks for Lighthouse!... it''s been excellent so far... We''ve been using it at work since day 1 and personally I''m glad I don''t have to look at Mantis'' prehistoric interface any longer ;) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That DynamicRouting link you posted looks interesting but it also seems to merely _mask_ the standard routes rather than let each site have its own, which Jamis'' Buck does beautifully. RSL On 5/3/07, Levent Ali <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Russell Norris wrote: > > I''ve managed something similar to what you''re describing by using Jamis > > Buck''s routing_tricks plugin [ > > > http://weblog.jamisbuck.org/2006/10/26/monkey-patching-rails-extending-routes-2 > ]. > > I''m serving up multiple sites from the same app and each site served has > > its > > own routing. > > > > RSL > > cheers guys... > > I''ll look into the Mephisto codebase as well as Jamis Buck''s post right > away... > > I also found http://leflo.de/blog/2007/04/05/literal-urls-with-rails > which may be useful also... > > regards > levent > > ps: Rick... Thanks for Lighthouse!... it''s been excellent so far... > We''ve been using it at work since day 1 and personally I''m glad I don''t > have to look at Mantis'' prehistoric interface any longer ;) > > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---