Add media MVC
[cs356-p2-videostore.git] / app / views / video / list.rhtml
1 <h1>Listing videos</h1>
2
3 <table>
4   <tr>
5     <th>Video ID</th>
6     <th>Checked Out</th>
7     <th>Title</th>
8     <th>New Release</th>
9     <th>Genre</th>
10     <th>Director</th>
11     <th>Media</th>
12   </tr>
13   
14 <% for video in @videos %>
15   <tr>
16     <td><%=h video.id %></td>
17     <td><%=h video.checkedout? %></td>
18     <td><%=h video.title %></td>
19     <td><%=h video.newrelease %></td>
20     <td><%=h Videogenre.find(video.video_genre).name %></td>
21     <td><%=h video.director %></td>
22     <td><%=h Media.find(video.media).name %></td>
23     <td><%= link_to 'Show', :action => 'show', :id => video %></td>
24     <td><%= link_to 'Edit', :action => 'edit', :id => video %></td>
25     <td><%= link_to 'Destroy', { :action => 'destroy', :id => video }, :confirm => 'Are you sure?', :method => :post %></td>
26   </tr>
27 <% end %>
28 </table>
29
30 <%= link_to 'Previous page', { :page => @video_pages.current.previous } if @video_pages.current.previous %>
31 <%= link_to 'Next page', { :page => @video_pages.current.next } if @video_pages.current.next %> 
32
33 <br />
34
35 <%= link_to 'New video', :action => 'new' %>