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 %>

<%= @help_document.question %>

<%= @help_document.content %>

<div id="helpDocumentHelpful" data-help-document-id="<%=

@help_document.id %>">
Was this information helpful?
Yes or
No

<% end %>

Is this possible? Or do I need to have 2 partials, one for a “header”
and one for a “footer”?

Thanks!

On Saturday, May 21, 2011 1:29:44 AM UTC-6, egervari wrote:

and one for a “footer”?

Thanks!

If it is “nested layouts” you want, you my check out the following:

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”.

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 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