Add customers model-view-controller
[cs356-p2-videostore.git] / app / views / customer / list.rhtml
diff --git a/app/views/customer/list.rhtml b/app/views/customer/list.rhtml
new file mode 100644 (file)
index 0000000..fb29a65
--- /dev/null
@@ -0,0 +1,27 @@
+<h1>Listing customers</h1>
+
+<table>
+  <tr>
+  <% for column in Customer.content_columns %>
+    <th><%= column.human_name %></th>
+  <% end %>
+  </tr>
+  
+<% for customer in @customers %>
+  <tr>
+  <% for column in Customer.content_columns %>
+    <td><%=h customer.send(column.name) %></td>
+  <% end %>
+    <td><%= link_to 'Show', :action => 'show', :id => customer %></td>
+    <td><%= link_to 'Edit', :action => 'edit', :id => customer %></td>
+    <td><%= link_to 'Destroy', { :action => 'destroy', :id => customer }, :confirm => 'Are you sure?', :method => :post %></td>
+  </tr>
+<% end %>
+</table>
+
+<%= link_to 'Previous page', { :page => @customer_pages.current.previous } if @customer_pages.current.previous %>
+<%= link_to 'Next page', { :page => @customer_pages.current.next } if @customer_pages.current.next %> 
+
+<br />
+
+<%= link_to 'New customer', :action => 'new' %>