Upcoming Tournaments

<%= form_tag(tournaments_path, :method => "get", id: "search-form") do %> <%= text_field_tag :search, params[:search], placeholder: "Search Tournaments" %> <%= submit_tag "Search" %> <% end %>

Search by name or date YYYY-MM-DD


<% @tournaments.each do |tournament| %> <% end %>
Name Date <% if user_signed_in? %> <%= link_to ' New Tournament', new_tournament_path, :class=>"fas fa-plus" %> <% end %>
<%= link_to tournament.name, tournament %> <%= tournament.date %> <% if can? :manage, tournament %> <%= link_to '', edit_tournament_path(tournament), :class=>"fas fa-edit" %> <% if can? :destroy, tournament %> <%= link_to '', tournament, data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to delete #{tournament.name}?" }, :class=>"fas fa-trash-alt" %> <% end %> <% end %>
<%# Pagination controls %> <% if @total_pages.present? && @total_pages > 1 %>

<% start_index = ((@page - 1) * @per_page) + 1 end_index = [@page * @per_page, @total_count].min %> Showing <%= start_index %> - <%= end_index %> of <%= @total_count %> tournaments

<% end %>