Hello, I''m having a problem which is following: <div id="header"><img ...></div> <div id="navigation">[STUFF FROM THE DB]</div> <div id="submenu">[STUFF FROM THE DB]</div> <div id="content"><%= yield %></div> <div id="footer">[STUFF FROM THE DB]</div> How can I fill the [STUFF FROM THE DB] div''s when I only have one single yield? I can''t think of any possible solution... -- 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 -~----------~----~----~----~------~----~------~--~---
I''m not sure but guessing these things may change on a per-template basis. If so content_for may be what you''re looking for: http://railscasts.com/episodes/8 You could also use a partial to pull this off. -- Josh http://iammrjoshua.com Heinz Strunk wrote:> Hello, > > I''m having a problem which is following: > <div id="header"><img ...></div> > <div id="navigation">[STUFF FROM THE DB]</div> > <div id="submenu">[STUFF FROM THE DB]</div> > <div id="content"><%= yield %></div> > <div id="footer">[STUFF FROM THE DB]</div> > > How can I fill the [STUFF FROM THE DB] div''s when I only have one single > yield? I can''t think of any possible solution...-- 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 -~----------~----~----~----~------~----~------~--~---
Yep! Thanks a lot. -- 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 -~----------~----~----~----~------~----~------~--~---
One more question arose that Google and the search couldn''t answer: One of these div''s have the very same entry no matter what page is being loaded therefore I''d need have: <% content_for :footer do %> <%= render :partial => "shared/footer" %> <% end %> in every view and this is not very DRY. Is there any possibility to make it DRY? -- 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 should go into your layout (apps/views/layouts). -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Heinz Strunk Sent: Wednesday, October 22, 2008 10:01 AM To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] Re: 3 different areas, 1 yield?! One more question arose that Google and the search couldn''t answer: One of these div''s have the very same entry no matter what page is being loaded therefore I''d need have: <% content_for :footer do %> <%= render :partial => "shared/footer" %> <% end %> in every view and this is not very DRY. Is there any possibility to make it DRY? -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Heinz, You should really take a look at this: http://www.railsdev.ws/blog/3/modular-page-assembly-in-rails/ Cheers, Sazima On Oct 22, 1:35 pm, Heinz Strunk <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello, > > I''m having a problem which is following: > <div id="header"><img ...></div> > <div id="navigation">[STUFF FROM THE DB]</div> > <div id="submenu">[STUFF FROM THE DB]</div> > <div id="content"><%= yield %></div> > <div id="footer">[STUFF FROM THE DB]</div> > > How can I fill the [STUFF FROM THE DB] div''s when I only have one single > yield? I can''t think of any possible solution... > -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---