Make the table titles in the game list match the data
[cs356-p2-videostore.git] / app / views / coitem / list.rhtml
1 <h1>Listing coitems</h1>
2
3 <table>
4   <tr>
5   <th>Customer</th>
6   <th>Rentable</th>
7   <th>Overdue</th>
8   <% for column in Coitem.content_columns %>
9     <th><%= column.human_name %></th>
10   <% end %>
11   </tr>
12   
13 <% for coitem in @coitems %>
14   <tr>
15   <td><%=h coitem.customer.name %></td>
16   <td><%=h coitem.rentable.title %></td>
17   <td><%=h coitem.overdue? %></td>
18   <% for column in Coitem.content_columns %>
19     <td><%=h coitem.send(column.name) %></td>
20   <% end %>
21     <td><%= link_to 'Show', :action => 'show', :id => coitem %></td>
22     <td><%= link_to 'Edit', :action => 'edit', :id => coitem %></td>
23     <td><%= link_to 'Destroy', { :action => 'destroy', :id => coitem }, :confirm => 'Are you sure?', :method => :post %></td>
24   </tr>
25 <% end %>
26 </table>
27
28 <%= link_to 'Previous page', { :page => @coitem_pages.current.previous } if @coitem_pages.current.previous %>
29 <%= link_to 'Next page', { :page => @coitem_pages.current.next } if @coitem_pages.current.next %> 
30
31 <br />
32
33 <%= link_to 'New coitem', :action => 'new' %>