Add searching to the games controller
[cs356-p2-videostore.git] / app / views / game / searchresults.rhtml
1 <h1>Search Results</h1>
2
3 <% if @games.empty? %>
4 <p>Sorry, there were no results</p>
5 <% else %>
6 <table>
7   <tr>
8   <th>Game ID</th>
9   <th>Checked Out</th>
10   <% for column in Game.content_columns %>
11     <th><%= column.human_name %></th>
12   <% end %>
13   </tr>
14
15 <% for game in @games %>
16   <tr>
17   <td><%=h game.id %></td>
18   <td><%=h game.checkedout? %></td>
19   <% for column in Game.content_columns %>
20     <td><%=h game.send(column.name) %></td>
21   <% end %>
22     <td><%= link_to 'Show', :action => 'show', :id => game %></td>
23     <td><%= link_to 'Edit', :action => 'edit', :id => game %></td>
24     <td><%= link_to 'Destroy', { :action => 'destroy', :id => game }, :confirm => 'Are you sure?', :post => true %></td>
25   </tr>
26 <% end %>
27 </table>
28 <% end %>