On 26 May 2011 22:05, egervari <[email protected]> wrote:
> I have 2 pages that have almost the same content except for stuff in
> the middle. I'd basically like to have a sub-layout that wraps the
> content that is different - exactly the way a normal layout file
> would.

You can use yield and content_for, have a look at the Rails Guide on
Layouts and Rendering.

Colin
>
> How can I call into a layout inside of erb? I'd like to do something
> like this:
>
>    <%= render :sub-layout => "reusable-wrapper" %>
>        <lots-of-html-for-this-page />
>    <% end %>
>
> Inside of the reusable-wrapper, I am imagining a <%= yield %> just
> like the normal layouts have.
>
> I could use partials with a 'header' and 'footer' and wrap it that
> way, but then those separate documents won't be well-formed html and
> it will look like junk in my editor :(
>
> Anyway to achieve this with rails? 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 [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to