egervari
2011-May-21 07:29 UTC
How do you create a sub-layout or a partial that wraps a lot of custom html?
Basically I''d like to create a layout inside of a layout using erb. Something like this: <%= render :partial => ''support'' do %> <div id="helpDocumentView"> <h3><%= @help_document.question %></h3> <%= @help_document.content %> <div id="helpDocumentHelpful" data-help-document-id="<%@help_document.id %>"> <b>Was this information helpful?</b> <a href="#">Yes</a> or <a href="#">No</a> </div> </div> <% end %> Is this possible? Or do I need to have 2 partials, one for a "header" and one for a "footer"? Thanks! -- 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.
Kendall Gifford
2011-May-23 17:12 UTC
Re: How do you create a sub-layout or a partial that wraps a lot of custom html?
On Saturday, May 21, 2011 1:29:44 AM UTC-6, egervari wrote:> > Basically I''d like to create a layout inside of a layout using erb. > > Something like this: > > <%= render :partial => ''support'' do %> > <div id="helpDocumentView"> > <h3><%= @help_document.question %></h3> > > <%= @help_document.content %> > > <div id="helpDocumentHelpful" data-help-document-id="<%= > @help_document.id %>"> > <b>Was this information helpful?</b> > <a href="#">Yes</a> or > <a href="#">No</a> > </div> > </div> > <% end %> > > Is this possible? Or do I need to have 2 partials, one for a "header" > and one for a "footer"? > > Thanks!If it is "nested layouts" you want, you my check out the following: http://guides.rubyonrails.org/layouts_and_rendering.html#using-nested-layouts http://m.onkey.org/nested-layouts-in-rails-3 I use the method described in the second link for nested layouts. Anyhow, not sure if this is even what you''re looking for, just basing my guess of your use of the phrase "layout within a layout". -- 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.
Anyone running into issues with this? - I''m using rvm and have updated rvm to the latest version (1.6.13) - I created a clean gemset (using Ruby 1.9.2-head - p208) - I then tried "gem install rails --pre" I got: ERROR: Could not find a valid gem ''rails'' (>= 0) in any repository ERROR: Possible alternatives: rails - I could run "gem install rails" successfully so I have access to the internet and it isn''t an issue with a port being blocked - I then ran a rvm gemset empty <gemset-name> and confirmed with a gem list that there were now no local gems. - I then retried "gen install rails --pre" and got the same error. Any thoughts much appreciated! Best Wishes, Peter -- 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.