1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00
Files
wrestlingdev.com/app/views/weights/show.html.erb

52 lines
1.4 KiB
Plaintext

<p id="notice"><%= notice %></p>
<h1>Weight Class:<%= @weight.max %></h1>
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %> |
<% if user_signed_in? %>
<%= link_to "Edit #{@weight.max} Weight Class", edit_weight_path(@weight) %> |
<% end %>
<br>
<br>
<br>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>School</th>
<th>Seed</th>
<th>Record</th>
<th>Seed Criteria</th>
<th>Extra?</th>
<th>Actions for wrestler</th>
</tr>
</thead>
<tbody>
<% @wrestlers.order("original_seed asc").each do |wrestler| %>
<% if wrestler.weight_id == @weight.id %>
<tr>
<td><%= wrestler.name %></td>
<td><%= School.find(wrestler.school_id).name %></td>
<td><%= wrestler.original_seed %></td>
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
<td><%= wrestler.criteria %></td>
<td><% if wrestler.extra? == true %>
Yes
<% end %></td>
<td><%= link_to 'Show', wrestler , :class=>"btn" %>
<% if user_signed_in? %>
<%= link_to 'Edit', edit_wrestler_path(wrestler) , :class=>"btn" %>
<%= link_to 'Destroy', wrestler, method: :delete, data: { confirm: 'Are you sure?' } , :class=>"btn btn-danger" %></td>
<% end %>
</tr>
<% end %>
<% end %>
</tbody>
</table>