mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-13 00:26:31 +00:00
Added current season record for wrestlers and updated show command for weights and schools
This commit is contained in:
@@ -90,6 +90,6 @@ class WrestlersController < ApplicationController
|
|||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def wrestler_params
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Weight</th>
|
<th>Weight</th>
|
||||||
<th>Seed</th>
|
<th>Seed</th>
|
||||||
|
<th>Record</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
<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.original_seed %></td>
|
<td><%= wrestler.original_seed %></td>
|
||||||
|
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
|
||||||
<td>
|
<td>
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= link_to 'Show', wrestler , :class=>"btn" %>
|
<%= link_to 'Show', wrestler , :class=>"btn" %>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>School</th>
|
<th>School</th>
|
||||||
<th>Seed</th>
|
<th>Seed</th>
|
||||||
|
<th>Record</th>
|
||||||
<th>Actions for wrestler</th>
|
<th>Actions for wrestler</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
<td><%= wrestler.name %></td>
|
<td><%= wrestler.name %></td>
|
||||||
<td><%= School.find(wrestler.school_id).name %></td>
|
<td><%= School.find(wrestler.school_id).name %></td>
|
||||||
<td><%= wrestler.original_seed %></td>
|
<td><%= wrestler.original_seed %></td>
|
||||||
|
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
|
||||||
<td><%= link_to 'Show', wrestler , :class=>"btn" %>
|
<td><%= link_to 'Show', wrestler , :class=>"btn" %>
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= link_to 'Edit', edit_wrestler_path(wrestler) , :class=>"btn" %>
|
<%= link_to 'Edit', edit_wrestler_path(wrestler) , :class=>"btn" %>
|
||||||
|
|||||||
@@ -33,6 +33,15 @@
|
|||||||
<%= f.label :original_seed %><br>
|
<%= f.label :original_seed %><br>
|
||||||
<%= f.number_field :original_seed %>
|
<%= f.number_field :original_seed %>
|
||||||
</div>
|
</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">
|
<div class="actions">
|
||||||
<%= f.submit %>
|
<%= f.submit %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
class WrestlerAddWinLossColumn < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :wrestlers, :season_win, :integer
|
||||||
|
add_column :wrestlers, :season_loss, :integer
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20140122151620) do
|
ActiveRecord::Schema.define(version: 20140123035131) do
|
||||||
|
|
||||||
create_table "schools", force: true do |t|
|
create_table "schools", force: true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
@@ -63,6 +63,8 @@ ActiveRecord::Schema.define(version: 20140122151620) do
|
|||||||
t.integer "original_seed"
|
t.integer "original_seed"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
t.integer "season_win"
|
||||||
|
t.integer "season_loss"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user