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