diff --git a/app/controllers/wrestlers_controller.rb b/app/controllers/wrestlers_controller.rb
index d47711d..bc6c8ef 100644
--- a/app/controllers/wrestlers_controller.rb
+++ b/app/controllers/wrestlers_controller.rb
@@ -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
diff --git a/app/views/schools/show.html.erb b/app/views/schools/show.html.erb
index 967aac9..6d61f0f 100644
--- a/app/views/schools/show.html.erb
+++ b/app/views/schools/show.html.erb
@@ -36,6 +36,7 @@
Name |
Weight |
Seed |
+ Record |
Actions |
@@ -47,6 +48,7 @@
<%= wrestler.name %> |
<%= Weight.find(wrestler.weight_id).max %> |
<%= wrestler.original_seed %> |
+ <%= wrestler.season_win %>-<%= wrestler.season_loss %> |
<% if user_signed_in? %>
<%= link_to 'Show', wrestler , :class=>"btn" %>
diff --git a/app/views/weights/show.html.erb b/app/views/weights/show.html.erb
index 597206f..1d1ebae 100644
--- a/app/views/weights/show.html.erb
+++ b/app/views/weights/show.html.erb
@@ -16,6 +16,7 @@
| Name |
School |
Seed |
+ Record |
Actions for wrestler |
@@ -26,6 +27,7 @@
<%= wrestler.name %> |
<%= School.find(wrestler.school_id).name %> |
<%= wrestler.original_seed %> |
+ <%= wrestler.season_win %>-<%= wrestler.season_loss %> |
<%= link_to 'Show', wrestler , :class=>"btn" %>
<% if user_signed_in? %>
<%= link_to 'Edit', edit_wrestler_path(wrestler) , :class=>"btn" %>
diff --git a/app/views/wrestlers/_form.html.erb b/app/views/wrestlers/_form.html.erb
index 4eb641c..14e9726 100644
--- a/app/views/wrestlers/_form.html.erb
+++ b/app/views/wrestlers/_form.html.erb
@@ -33,6 +33,15 @@
<%= f.label :original_seed %>
<%= f.number_field :original_seed %>
+
+ <%= f.label "Season Wins" %>
+ <%= f.number_field :season_win %>
+
+
+ <%= f.label "Season Losses" %>
+ <%= f.number_field :season_loss %>
+
+
<%= f.submit %>
diff --git a/db/migrate/20140123035131_wrestler_add_win_loss_column.rb b/db/migrate/20140123035131_wrestler_add_win_loss_column.rb
new file mode 100644
index 0000000..7916459
--- /dev/null
+++ b/db/migrate/20140123035131_wrestler_add_win_loss_column.rb
@@ -0,0 +1,7 @@
+class WrestlerAddWinLossColumn < ActiveRecord::Migration
+ def change
+ add_column :wrestlers, :season_win, :integer
+ add_column :wrestlers, :season_loss, :integer
+
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 41e0453..65a9b60 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# 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|
t.string "name"
@@ -63,6 +63,8 @@ ActiveRecord::Schema.define(version: 20140122151620) do
t.integer "original_seed"
t.datetime "created_at"
t.datetime "updated_at"
+ t.integer "season_win"
+ t.integer "season_loss"
end
end
|