Skip to content

Commit

Permalink
Added support for display has_many relationships.
Browse files Browse the repository at this point in the history
- Added has_many view
- Added helper method for displaying link to other scaffolding objects
  • Loading branch information
Aaron Wheeler committed Apr 26, 2008
1 parent f8d1a5f commit bea4d3d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/merb_autoscaffold/views/_has_many_show.html.erb
@@ -0,0 +1,19 @@
<%
# Partial for displaying the items in a has_many relationship
#
# ==== Parameters
# model<DataMapper::Base>: the model to which the relationship belongs
# association<DataMapper::Associations::HasManyAssociation>: the association that forms the
# basis for the relationship
%>

<dt><%= association.name.to_s.capitalize %></dt>
<dd>
<ul>
<% for obj in model.send( association.name ) %>
<li>
<%= scaf_link(obj) %>
</li>
<% end %>
</ul>
</dd>

0 comments on commit bea4d3d

Please sign in to comment.