1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-05 14:17:20 +00:00

Added my tournaments page

This commit is contained in:
2015-12-15 15:24:13 -05:00
parent ec1c7c7fd4
commit 41ca12c5d1
5 changed files with 49 additions and 3 deletions

View File

@@ -0,0 +1,38 @@
<h1>My Tournaments</h1>
<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="display compact cell-border" id="tournamentList">
<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 btn-default" %>
<% if tournament_permissions(tournament) %>
<%= link_to 'Edit', edit_tournament_path(tournament), :class=>"btn btn-primary" %>
<%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<br>