I have a complex structure (a lot of <div>'s) which occures in a couple
of views.
I think I red somewhere that it is possible to put this structure in a
seperate .rb file, which can then be included into the other (.rb)
files.
Can someone point me into the right direction of how to do this ??
Thnx a lot
LuCa
--
Posted via http://www.ruby-forum.com/.
Partials are your friend.
#app/views/foo/index.rhtml
<% @items.each do |item| %>
<%= render :partial => 'item', :locals => {:item => item} %>
<% end %>
#app/views/foo/_item.rhtml
<div class="item">
<h1>Item #<%= item.id %></h1>
<%= textilize(item.description) %>
</div>