<h1>Listing genres</h1>

<table>
  <tr>
    <th>Genre name</th>
    <th>Genre description</th>
    <th># of movies</th>
  </tr>

<% @genres.each do |genre| %>
  <tr>
    <td><%=h genre.genre_name %></td>
    <td><%=h genre.genre_description %></td>
    <td><%=h genre.movies.count %></td>
    <td><%= link_to 'Show', genre %></td>
    <td><%= link_to 'Edit', edit_genre_path(genre) %></td>
    <td><%= link_to 'Movies',  :controller => "movies", :action => "movielist",  :id => genre  %></td>
                              
    <td><%= link_to 'Destroy', genre, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>
<%= image_tag 'genre_sample.png' unless @genres.any? %>

<br />

<%= link_to 'New genre', new_genre_path %>