1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-04 22:03:49 +00:00

Added current season record for wrestlers and updated show command for weights and schools

This commit is contained in:
Jacob Cody Wimer
2014-01-22 22:57:14 -05:00
parent c551852dfb
commit 7b726b38c0
6 changed files with 24 additions and 2 deletions

View File

@@ -90,6 +90,6 @@ class WrestlersController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def wrestler_params
params.require(:wrestler).permit(:name, :school_id, :weight_id, :seed, :original_seed)
params.require(:wrestler).permit(:name, :school_id, :weight_id, :seed, :original_seed, :season_win, :season_loss)
end
end

View File

@@ -36,6 +36,7 @@
<th>Name</th>
<th>Weight</th>
<th>Seed</th>
<th>Record</th>
<th>Actions</th>
</tr>
</thead>
@@ -47,6 +48,7 @@
<td><%= wrestler.name %></td>
<td><%= Weight.find(wrestler.weight_id).max %></td>
<td><%= wrestler.original_seed %></td>
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
<td>
<% if user_signed_in? %>
<%= link_to 'Show', wrestler , :class=>"btn" %>

View File

@@ -16,6 +16,7 @@
<th>Name</th>
<th>School</th>
<th>Seed</th>
<th>Record</th>
<th>Actions for wrestler</th>
</tr>
</thead>
@@ -26,6 +27,7 @@
<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><%= link_to 'Show', wrestler , :class=>"btn" %>
<% if user_signed_in? %>
<%= link_to 'Edit', edit_wrestler_path(wrestler) , :class=>"btn" %>

View File

@@ -33,6 +33,15 @@
<%= f.label :original_seed %><br>
<%= f.number_field :original_seed %>
</div>
<div class="field">
<%= f.label "Season Wins" %><br>
<%= f.number_field :season_win %>
</div>
<div class="field">
<%= f.label "Season Losses" %><br>
<%= f.number_field :season_loss %>
</div>
<div class="actions">
<%= f.submit %>
</div>