Dan Poynor
2007-Jan-16 18:52 UTC
Use the same page header/footer across apps within a domain?
Let''s say I have four different rails apps which use different databases... blog.mydomain.com store.mydomain.com links.mydomain.com news.mydomain.com I''d like each app to have a consistent look and feel starting with using the same header, footer and stylesheets on the pages that are displayed in the browser. Is there someway to do that? Can the header and footer code sit in a separate partials directory which they can all share? Would using sub-directories instead of sub-domains make this easier to manage? I''d like to avoid having to duplicate the header and footer assets for each Rails app. I''m curious what others have come up with to solve similar issues. Thanks, Dan Poynor -- 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 -~----------~----~----~----~------~----~------~--~---
Helder Oliveira
2007-Jan-16 19:49 UTC
Re: Use the same page header/footer across apps within a dom
Do you use a vps ? maybe "ln -s" will be your answer, dunno really if it will work, later i try it. If yes you can point the layout folder to the unique layout folder :P hope you got it -- 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 -~----------~----~----~----~------~----~------~--~---
Stephan Wehner
2007-Jan-16 21:33 UTC
Re: Use the same page header/footer across apps within a dom
Dan Poynor wrote:> Let''s say I have four different rails apps which use different > databases... > blog.mydomain.com > store.mydomain.com > links.mydomain.com > news.mydomain.com > > I''d like each app to have a consistent look and feel starting with using > the same header, footer and stylesheets on the pages that are displayed > in the browser. Is there someway to do that? > > Can the header and footer code sit in a separate partials directory > which they can all share?I could imagine you create a plugin, that contains the method and data that you place in these headers and footers. Then your layouts could say <%= mydomain_header %> . . . <%= mydomain_footer %> and these methods are taken from the plugin code. The plugin code could be checked out as external projects from subversion repository for example, to synchronize them as you like. Haven''t thought through how you would provide for dynamic content; I don''t know if the headers and footers have dynamic content (Logged in users?) Your stylesheets could be accessed through http://mydomain.com/styles/style.css. Don''t know if you find it difficult to set up a server for this or you already have one. Stephan -- 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 -~----------~----~----~----~------~----~------~--~---
Stephan Wehner
2007-Jan-16 21:42 UTC
Re: Use the same page header/footer across apps within a dom
Stephan Wehner wrote:> I could imagine you create a plugin, that contains the method and data > that you place in these headers and footers.Sorry, to clarify, to be placed in the lib directory .. (not vendor/plugins) Stephan -- 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 -~----------~----~----~----~------~----~------~--~---
Benjamin Curtis
2007-Jan-16 22:54 UTC
Re: Use the same page header/footer across apps within a domain?
You might find it useful to take a look at the theme_support plugin (http://www.agilewebdevelopment.com/plugins/theme_support) to see an example of how to extend the places that Rails will search for layouts and views. From that starting point, it shouldn''t be hard to come up with a shared path you could use for your various apps. An alternative approach if you are using subversion would be to use svn:externals to share paths like app/views/layouts and public/ stylesheets. This approach would probably be more straightforward. -- Building an e-commerce site with Rails? http://www.agilewebdevelopment.com/rails-ecommerce Meet up at RailsConf: http://railsconf2007.conferencemeetup.com/ On Jan 16, 2007, at 10:52 AM, Dan Poynor wrote:> > Let''s say I have four different rails apps which use different > databases... > blog.mydomain.com > store.mydomain.com > links.mydomain.com > news.mydomain.com > > I''d like each app to have a consistent look and feel starting with > using > the same header, footer and stylesheets on the pages that are > displayed > in the browser. Is there someway to do that? > > Can the header and footer code sit in a separate partials directory > which they can all share? > > Would using sub-directories instead of sub-domains make this easier to > manage? > > I''d like to avoid having to duplicate the header and footer assets for > each Rails app. > > I''m curious what others have come up with to solve similar issues. > > Thanks, > Dan Poynor > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Andrew Skegg
2007-Jan-16 23:59 UTC
Re: Use the same page header/footer across apps within a dom
Dan Poynor wrote:> Let''s say I have four different rails apps which use different > databases... > blog.mydomain.com > store.mydomain.com > links.mydomain.com > news.mydomain.com > > I''d like each app to have a consistent look and feel starting with using > the same header, footer and stylesheets on the pages that are displayed > in the browser. Is there someway to do that? > > Can the header and footer code sit in a separate partials directory > which they can all share?Not as far as I know, but you might be able to implement and API on one "master" domain that spits back HTML.> > Would using sub-directories instead of sub-domains make this easier to > manage?Yes.> > I''d like to avoid having to duplicate the header and footer assets for > each Rails app. > > I''m curious what others have come up with to solve similar issues. > > Thanks, > Dan PoynorAnother way might be to use symbolic links for a shared directory (if all your sites are on one server), or maybe configure apache to retrieve content from another site using mod_proxy? -- 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 -~----------~----~----~----~------~----~------~--~---
Steven Smith
2007-Jan-21 04:56 UTC
Re: Use the same page header/footer across apps within a domain?
We''ve used symlinks to share things in the past between projects so that we only have one copy -- models, images, etc. should work as well for your views. Steven -- Steven Smith, CEO, FiveRuns http://www.fiveruns.com On Jan 16, 2007, at 12:52 PM, Dan Poynor wrote:> > Let''s say I have four different rails apps which use different > databases... > blog.mydomain.com > store.mydomain.com > links.mydomain.com > news.mydomain.com > > I''d like each app to have a consistent look and feel starting with > using > the same header, footer and stylesheets on the pages that are > displayed > in the browser. Is there someway to do that? > > Can the header and footer code sit in a separate partials directory > which they can all share? > > Would using sub-directories instead of sub-domains make this easier to > manage? > > I''d like to avoid having to duplicate the header and footer assets for > each Rails app. > > I''m curious what others have come up with to solve similar issues. > > Thanks, > Dan Poynor > > -- > 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 -~----------~----~----~----~------~----~------~--~---