mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-10 15:50:50 +00:00
Fixed school view
This commit is contained in:
@@ -11,6 +11,7 @@ class SchoolsController < ApplicationController
|
|||||||
# GET /schools/1.json
|
# GET /schools/1.json
|
||||||
def show
|
def show
|
||||||
@wrestlers = Wrestler.all
|
@wrestlers = Wrestler.all
|
||||||
|
@tournament = Tournament.find(@school.tournament_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /schools/new
|
# GET /schools/new
|
||||||
|
|||||||
@@ -15,15 +15,19 @@
|
|||||||
<%= Tournament.find(@school.tournament_id).name %>
|
<%= Tournament.find(@school.tournament_id).name %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<%= link_to "Edit #{@school.name}", edit_school_path(@school) %> |
|
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %> |
|
||||||
<%= link_to 'Back to Schools', schools_path %> |
|
<% if user_signed_in? %>
|
||||||
<%= link_to 'Back to Admin', '/admin/index' %>
|
<%= link_to "Edit #{@school.name}", edit_school_path(@school) %> |
|
||||||
|
<%= link_to 'Back to Admin', '/admin/index' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<%= link_to "New #{@school.name} Wrestler" , "/wrestlers/new?school=#{@school.id}" %>
|
<% if user_signed_in? %>
|
||||||
|
<%= link_to "New #{@school.name} Wrestler" , "/wrestlers/new?school=#{@school.id}" %>
|
||||||
|
<% end %>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@@ -33,7 +37,6 @@
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Weight</th>
|
<th>Weight</th>
|
||||||
<th>Seed</th>
|
<th>Seed</th>
|
||||||
<th>Original seed</th>
|
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -44,9 +47,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><%= wrestler.name %></td>
|
<td><%= wrestler.name %></td>
|
||||||
<td><%= Weight.find(wrestler.weight_id).max %></td>
|
<td><%= Weight.find(wrestler.weight_id).max %></td>
|
||||||
<td><%= wrestler.seed %></td>
|
|
||||||
<td><%= wrestler.original_seed %></td>
|
<td><%= wrestler.original_seed %></td>
|
||||||
<td><%= link_to 'Show', wrestler , :class=>"btn" %><%= 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>
|
<td>
|
||||||
|
<% if user_signed_in? %>
|
||||||
|
<%= link_to 'Show', wrestler , :class=>"btn" %>
|
||||||
|
<%= link_to 'Edit', edit_wrestler_path(wrestler), :class=>"btn" %>
|
||||||
|
<%= link_to 'Destroy', wrestler, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -29,10 +29,6 @@
|
|||||||
<%= f.label 'Weight Class' %><br>
|
<%= f.label 'Weight Class' %><br>
|
||||||
<%= f.collection_select :weight_id, Weight.all, :id, :max %>
|
<%= f.collection_select :weight_id, Weight.all, :id, :max %>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
|
||||||
<%= f.label :seed %><br>
|
|
||||||
<%= f.number_field :seed %>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<%= f.label :original_seed %><br>
|
<%= f.label :original_seed %><br>
|
||||||
<%= f.number_field :original_seed %>
|
<%= f.number_field :original_seed %>
|
||||||
|
|||||||
Reference in New Issue
Block a user