Hi,
How can i render multiple views in rails?
For example i have two .rhtml files:
header.rhtml -> a chunk of html codes to be rendered on top of the
page
sidebar.rhtml -> also a chunk of html, to be rendered in the right
side of the page
How can i call this .rhtml files from the controller and assign it to
my layout? thanks!
<% content_for :sidebar do -%>
<%= render :partial => 'sidebar' -%>
<% end -%>
<% content_for :footer do -%>
<%= render :partial => 'footer' -%>
<% end -%>
<p>This text ends up in the #Content div in the layout as it is the default</p>
Try it and find out. It will be a hell of a lot quicker than waiting
for an answer from a mailing list. (Hint, check out the
DoubleRenderError exception ).