1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-02 21:24:25 +00:00
Files
wrestlingdev.com/app/views/tournaments/index.html.erb

47 lines
1.5 KiB
Plaintext

<h1>Upcoming Tournaments</h1> <%= form_tag(tournaments_path, :method => "get", id: "search-form") do %>
<%= text_field_tag :search, params[:search], placeholder: "Search Tournaments" %>
<%= submit_tag "Search" %>
<% end %>
<p>Search by name or date YYYY-MM-DD</p>
<script>
// $(document).ready(function() {
// $('#tournamentList').dataTable();
// pagingType: "bootstrap";
// } );
</script>
<% if user_signed_in? %>
<%= link_to 'New Tournament', new_tournament_path, :class=>"btn btn-success" %>
<% end %>
</br>
</br>
<table class="table table-striped table-bordered table-condensed" id="tournamentList">
<thead>
<tr>
<th>Name</th>
<th>Date</th>
<th></th>
</tr>
</thead>
<tbody>
<% @tournaments.each do |tournament| %>
<tr>
<td><%= tournament.name %></td>
<td><%= tournament.date %></td>
<td><%= link_to 'Show', tournament, :class=>"btn btn-default btn-sm" %>
<% if can? :manage, tournament %>
<%= link_to 'Edit', edit_tournament_path(tournament), :class=>"btn btn-primary btn-sm" %>
<% end %>
<% if can? :destroy, tournament %>
<%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger btn-sm" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<br>