I need to develop an application which will have one codebase but different sites will be accessing the same codebase. Now the problem is that how can render different look and feel for the same view based on the site the request came from. For eg. if request came from www.a.com then all the screens will have the same functionality but differnt look then the request from www.b.com. I can figure out the domain from where the request came, but don''t know how to setup the base for the view based on domain. Basically , I want one code base i.e. one set of controllers but n sets of views for each method if I am serving n sites. Any help is greatly appreciated. -- 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 -~----------~----~----~----~------~----~------~--~---
dasil003
2007-May-21 00:29 UTC
Re: Different views for different sites from same codebase?
Check out theme_support from Matt McCray (http://mattmccray.com/). He''s been MIA and you will need to patch it to work with Rails 1.2. The plugin is basically extracted from Typo themes, so it has some limitations. Basically it lets you override any template from an application. So you can probably accomplish what you are looking for just by dropping in a new layout, and creating some wrapper code to select the theme based on the domain name. I am currently using it for a major product, and have submitted a couple patches to Matt but heard nothing back. I''m thinking about creating a derivative plugin called "multisite" or something that is specifically focused on what you''re asking. On May 20, 6:14 pm, Rm Rm <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I need to develop an application which will have one codebase but > different sites will be accessing the same codebase. Now the problem is > that how can render different look and feel for the same view based on > the site the request came from. For eg. if request came fromwww.a.com > then all the screens will have the same functionality but differnt look > then the request fromwww.b.com. I can figure out the domain from where > the request came, but don''t know how to setup the base for the view > based on domain. Basically , I want one code base i.e. one set of > controllers but n sets of views for each method if I am serving n sites. > > Any help is greatly appreciated. > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Sean T Allen
2007-May-21 00:36 UTC
Re: Different views for different sites from same codebase?
There is the productize code as well. Technically not compat. with Rails 1.0 but there is this: http://cwilliams.textdriven.com/articles/2006/02/10/productize-and-rails-1-0 that has working code for that. Rm Rm wrote:> I need to develop an application which will have one codebase but > different sites will be accessing the same codebase. Now the problem is > that how can render different look and feel for the same view based on > the site the request came from. For eg. if request came from www.a.com > then all the screens will have the same functionality but differnt look > then the request from www.b.com. I can figure out the domain from where > the request came, but don''t know how to setup the base for the view > based on domain. Basically , I want one code base i.e. one set of > controllers but n sets of views for each method if I am serving n sites. > > Any help is greatly appreciated. > >