mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-15 20:46:57 +00:00
Updated re-directs, added weights to tournament#show, and edited a few views
This commit is contained in:
@@ -54,6 +54,36 @@
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<% if user_signed_in? %>
|
||||
<%= link_to "New #{@tournament.name} Weight" , "/weights/new?tournament=#{@tournament.id}" %>
|
||||
<% end %>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Weights</h3>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Weight Class</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @weights.each do |weight| %>
|
||||
<tr>
|
||||
<td><%= weight.max %></td>
|
||||
<td><%= link_to 'Show', weight, :class=>"btn" %>
|
||||
<% if user_signed_in? %>
|
||||
<%= link_to 'Edit', edit_weight_path(weight), :class=>"btn" %>
|
||||
<%= link_to 'Destroy', weight, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,16 @@
|
||||
<%= f.label :max %><br>
|
||||
<%= f.number_field :max %>
|
||||
</div>
|
||||
|
||||
<% if @weight %>
|
||||
<%= f.hidden_field :tournament_id, :value => @tournament_field %>
|
||||
<% else %>
|
||||
<div class="field">
|
||||
<%= f.label 'Tournament' %><br>
|
||||
<%= f.collection_select :tournament_id, Tournament.all, :id, :name %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
<%= link_to "Edit #{@weight.max} Weight Class", edit_weight_path(@weight) %> |
|
||||
<%= link_to 'Back to Weight Classes', weights_path %> |
|
||||
<%= link_to 'Back to Admin', '/admin/index' %>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<div class="field">
|
||||
<%= f.label 'Weight Class' %><br>
|
||||
<%= f.collection_select :weight_id, Weight.all, :id, :max %>
|
||||
<%= f.collection_select :weight_id, @weight, :id, :max %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :original_seed %><br>
|
||||
|
||||
Reference in New Issue
Block a user