mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-16 21:11:38 +00:00
Added seeding criteria to wrestlers
This commit is contained in:
@@ -102,6 +102,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, :season_win, :season_loss)
|
params.require(:wrestler).permit(:name, :school_id, :weight_id, :seed, :original_seed, :season_win, :season_loss,:criteria)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
<th>Weight</th>
|
<th>Weight</th>
|
||||||
<th>Seed</th>
|
<th>Seed</th>
|
||||||
<th>Record</th>
|
<th>Record</th>
|
||||||
|
<th>Seed Criteria</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
<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><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
|
||||||
|
<td><%= wrestler.criteria %></td>
|
||||||
<td>
|
<td>
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= link_to 'Show', wrestler , :class=>"btn" %>
|
<%= link_to 'Show', wrestler , :class=>"btn" %>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<th>School</th>
|
<th>School</th>
|
||||||
<th>Seed</th>
|
<th>Seed</th>
|
||||||
<th>Record</th>
|
<th>Record</th>
|
||||||
|
<th>Seed Criteria</th>
|
||||||
<th>Actions for wrestler</th>
|
<th>Actions for wrestler</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
<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><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
|
||||||
|
<td><%= wrestler.criteria %></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" %>
|
||||||
|
|||||||
@@ -42,6 +42,11 @@
|
|||||||
<%= f.number_field :season_loss %>
|
<%= f.number_field :season_loss %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<%= f.label "Seed Criteria" %><br>
|
||||||
|
<%= f.text_field :criteria %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<%= f.submit %>
|
<%= f.submit %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
class AddSeedCriteriaToWrestler < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :wrestlers, :criteria, :string
|
||||||
|
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: 20140130153634) do
|
ActiveRecord::Schema.define(version: 20140131123907) do
|
||||||
|
|
||||||
create_table "matches", force: true do |t|
|
create_table "matches", force: true do |t|
|
||||||
t.integer "r_id"
|
t.integer "r_id"
|
||||||
@@ -87,6 +87,7 @@ ActiveRecord::Schema.define(version: 20140130153634) do
|
|||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "season_win"
|
t.integer "season_win"
|
||||||
t.integer "season_loss"
|
t.integer "season_loss"
|
||||||
|
t.string "criteria"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user