6b5bb14427e0347c8f3fc6eb4f3fc86d31137a1f
[cs356-p2-videostore.git] / app / views / bitem / list.rhtml
1 <h1>Listing bitems</h1>
2
3 <table>
4   <tr>
5   <th>Customer Name</th>
6   <th>Merchandise Name</th>
7   <% for column in Bitem.content_columns %>
8     <th><%= column.human_name %></th>
9   <% end %>
10   </tr>
11   
12 <% for bitem in @bitems %>
13   <tr>
14   <td><%=h bitem.customer.name %></td>
15   <td><%=h bitem.merchandise.name %></td>
16   <% for column in Bitem.content_columns %>
17     <td><%=h bitem.send(column.name) %></td>
18   <% end %>
19     <td><%= link_to 'Show', :action => 'show', :id => bitem %></td>
20     <td><%= link_to 'Edit', :action => 'edit', :id => bitem %></td>
21     <td><%= link_to 'Destroy', { :action => 'destroy', :id => bitem }, :confirm => 'Are you sure?', :method => :post %></td>
22   </tr>
23 <% end %>
24 </table>
25
26 <%= link_to 'Previous page', { :page => @bitem_pages.current.previous } if @bitem_pages.current.previous %>
27 <%= link_to 'Next page', { :page => @bitem_pages.current.next } if @bitem_pages.current.next %> 
28
29 <br />
30
31 <%= link_to 'New bitem', :action => 'new' %>