Listing Tournaments

<% if @tournaments.length > 0 %> <% @tournaments.each do |tournament| %> <% end %>
Name Game Status Players per team Teams per match Randomized teams
<%= tournament.name %> <% case tournament.status when 0 %> <%= form_tag(tournament_path(tournament), method: "put") do %> <%= submit_tag("Join") %> <% end %> <% when 1 %> Ongoing <% else %> Closed <%end %> <%= tournament.min_players_per_team %> <% if tournament.min_players_per_team != tournament.max_players_per_team %> to <%= tournament.max_players_per_team %> <% end %> <%= tournament.min_teams_per_match %> <% if tournament.min_teams_per_match != tournament.max_teams_per_match %> to <%= tournament.max_teams_per_match %> <% end %> <%= tournament.randomized_teams %> <%= link_to 'Show', tournament %> <%= link_to 'Edit', edit_tournament_path(tournament) %> <%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %>
<% else %>

No tournaments going on right now... Why not start your own?

<% end %>
<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %>