Christian Fazzini
2010-Sep-01 01:53 UTC
Sidebars should be placed in the main layout or the action''s view
Just wondering. Should sidebars be in the view or in the main layout? If they are in the main layout. i.e. with the following code: <div class="span-24"> <div id="content" class="span-18"> <%= yield %> </div> <div id="side-panel" class="span-6 last"> sidebar </div> </div> If the sidebar has dynamic content (i.e. data being set from the action), how can this be displayed? So I am thinking that the sidebar must be in the action''s view. What are your thoughts? What is the rails way of doing this? Or perhaps, is there a plugin that one can use? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Christian Fazzini
2010-Sep-01 02:29 UTC
Re: Sidebars should be placed in the main layout or the action''s view
Ok, I found out a better solution. Using <%= yield :side_panel %> in main layout and <% content_for :side_panel do %><%= render :partial => ''side_panel_show'', :object_topass => @object_topass %><% end %> On Sep 1, 9:53 am, Christian Fazzini <christian.fazz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Just wondering. Should sidebars be in the view or in the main layout? > > If they are in the main layout. i.e. with the following code: > > <div class="span-24"> > > <div id="content" class="span-18"> > > <%= yield %> > > </div> > > <div id="side-panel" class="span-6 last"> > > sidebar > > </div> > > </div> > > If the sidebar has dynamic content (i.e. data being set from the > action), how can this be displayed? So I am thinking that the sidebar > must be in the action''s view. > > What are your thoughts? What is the rails way of doing this? Or > perhaps, is there a plugin that one can use?-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.