From bea4d3d9ccfd3f0793d4e30fcfb20d56fccc0dcc Mon Sep 17 00:00:00 2001 From: Aaron Wheeler Date: Sat, 26 Apr 2008 10:08:10 +0900 Subject: [PATCH] Added support for display has_many relationships. - Added has_many view - Added helper method for displaying link to other scaffolding objects --- .../views/_has_many_show.html.erb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/merb_autoscaffold/views/_has_many_show.html.erb diff --git a/lib/merb_autoscaffold/views/_has_many_show.html.erb b/lib/merb_autoscaffold/views/_has_many_show.html.erb new file mode 100644 index 0000000..0b99098 --- /dev/null +++ b/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: the model to which the relationship belongs + # association: the association that forms the + # basis for the relationship +%> + +
<%= association.name.to_s.capitalize %>
+
+
    + <% for obj in model.send( association.name ) %> +
  • + <%= scaf_link(obj) %> +
  • + <% end %> +
+
\ No newline at end of file