<h1>Listing photos</h1>

<table>
  <tr>
    <th>Description</th>
    <th>Type</th>
    <th>Actor's name</th>
  </tr>
<% @photos.each do |photo| %>
  <tr>
    <td><%=h photo.description %></td>
    <td><%=h photo.content_type %></td>
    <% @actor=Actor.find(photo.actor_id) %>
    <td><%= @actor.full_name %>    
    <td><%= link_to 'Show', photo %></td>
    <td><%= link_to 'Edit', edit_photo_path(photo) %></td>
    <td><%= link_to 'Destroy', photo, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'Upload new photo', new_photo_path %>