Alright, what would be the best practice for this?: I have several domains, like www.ryankopf.com www.cmuscatine.com www.aiowa.com Some have lots of static pages (first two) but others are more dynamic (picture gallery on the third one). I am working on re-implementing them in RoR on my GoDaddy apache shared hosting server. I want to have just one ruby application, because I have features that I''m going to want to use across the board... but I''m trying to figure out the best way to do this. It was suggested just to create a static.rb controller, then in views/ static/ put the pages as .rhtml. Then I would use apache''s mod_rewrite or something like that to direct www.ryankopf.com/ryan_kopf_static/page.html to the RoR program. But I have layouts in place on each site, and each is different, so wouldn''t I have to create a new controller for each website? (I use just one file for the layout so that I can easily change it). What''s the don''t-repeat-yourself method of doing this? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You can specify a layout when you render an action, so you could have a single controller. render :action => ''whatever'', :layout => ''layout1'' -- 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 -~----------~----~----~----~------~----~------~--~---
Okay. Is there a way I can figure out which domain is calling? Then I could get really simple and define a Website model. The attributes would be :layout - >name of layout :pagename - > page file location (example :homepage -> "/views/Website/ryankopf/homepage.txt") Is that in the environment somewhere maybe? On Jan 9, 3:29 pm, Jeremy Weiskotten <rails-mailing-l...@andreas- s.net> wrote:> You can specify a layout when you render an action, so you could have a > single controller. > > render :action => ''whatever'', :layout => ''layout1'' > -- > 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 -~----------~----~----~----~------~----~------~--~---