Re: Django-like nested templates with Rails layouts

Thorsten Müller
Sun, 06 Jul 2008 09:03:35 -0000

I don''t know, what exactly "nested templates" in Django do...

But you can nest partials into each other as deep as you like, you can
even nest one in itself recursively.
<%= render :template => "another_partial" %>
or you can use the content_for thingy in a layout (eg for the menu
part)

say:
<%= yield :some_menu %>

and then in the partial to be rendered:
<% content_for :some_menu %>
  .. some html here...
  ...or another render :partial => :whatever_menu...
<% end %>

There are so many ways to define & render partials, hand in some
data to them with :locals, :object and so on, that I can''t imagine
much
you ould not do with them.