<h1>Pick A Tournament</h1>
<% if user_signed_in? %>
  <%= link_to 'New Tournament', new_tournament_path, :class=>"btn" %>
<% end %>
</br>
</br>
<table class="table table-striped table-bordered">
  <thead>
    <tr>
      <th>Name</th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% @tournaments.each do |tournament| %>
      <tr>
        <td><%= tournament.name %></td>
        <td><%= link_to 'Show', tournament, :class=>"btn" %>
          <% if user_signed_in? %>
            <%= link_to 'Edit', edit_tournament_path(tournament), :class=>"btn" %>
            <%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>


