mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-30 19:22:21 +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.
|
||||
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
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<th>Weight</th>
|
||||
<th>Seed</th>
|
||||
<th>Record</th>
|
||||
<th>Seed Criteria</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -49,6 +50,7 @@
|
||||
<td><%= Weight.find(wrestler.weight_id).max %></td>
|
||||
<td><%= wrestler.original_seed %></td>
|
||||
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
|
||||
<td><%= wrestler.criteria %></td>
|
||||
<td>
|
||||
<% if user_signed_in? %>
|
||||
<%= link_to 'Show', wrestler , :class=>"btn" %>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<th>School</th>
|
||||
<th>Seed</th>
|
||||
<th>Record</th>
|
||||
<th>Seed Criteria</th>
|
||||
<th>Actions for wrestler</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -28,6 +29,7 @@
|
||||
<td><%= School.find(wrestler.school_id).name %></td>
|
||||
<td><%= wrestler.original_seed %></td>
|
||||
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
|
||||
<td><%= wrestler.criteria %></td>
|
||||
<td><%= link_to 'Show', wrestler , :class=>"btn" %>
|
||||
<% if user_signed_in? %>
|
||||
<%= link_to 'Edit', edit_wrestler_path(wrestler) , :class=>"btn" %>
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
<%= f.number_field :season_loss %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label "Seed Criteria" %><br>
|
||||
<%= f.text_field :criteria %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</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.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20140130153634) do
|
||||
ActiveRecord::Schema.define(version: 20140131123907) do
|
||||
|
||||
create_table "matches", force: true do |t|
|
||||
t.integer "r_id"
|
||||
@@ -87,6 +87,7 @@ ActiveRecord::Schema.define(version: 20140130153634) do
|
||||
t.datetime "updated_at"
|
||||
t.integer "season_win"
|
||||
t.integer "season_loss"
|
||||
t.string "criteria"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user