mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Break down wrestlers points on the show page
This commit is contained in:
@@ -3,13 +3,14 @@ class WrestlersController < ApplicationController
|
|||||||
before_action :check_access, only: [:new,:create,:update,:destroy,:edit,:update_pool]
|
before_action :check_access, only: [:new,:create,:update,:destroy,:edit,:update_pool]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# GET /wrestlers/1
|
# GET /wrestlers/1
|
||||||
# GET /wrestlers/1.json
|
# GET /wrestlers/1.json
|
||||||
def show
|
def show
|
||||||
@school = @wrestler.school
|
@school = @wrestler.school
|
||||||
@tournament = @wrestler.tournament
|
@tournament = @wrestler.tournament
|
||||||
|
@wrestler_points_calc = CalculateWrestlerTeamScore.new(@wrestler)
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /wrestlers/new
|
# GET /wrestlers/new
|
||||||
@@ -104,7 +105,7 @@ class WrestlersController < ApplicationController
|
|||||||
def set_wrestler
|
def set_wrestler
|
||||||
@wrestler = Wrestler.where(:id => params[:id]).includes(:school, :weight, :tournament, :matches).first
|
@wrestler = Wrestler.where(:id => params[:id]).includes(:school, :weight, :tournament, :matches).first
|
||||||
end
|
end
|
||||||
|
|
||||||
# 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,:criteria,:extra,:offical_weight,:pool)
|
params.require(:wrestler).permit(:name, :school_id, :weight_id, :seed, :original_seed, :season_win, :season_loss,:criteria,:extra,:offical_weight,:pool)
|
||||||
|
|||||||
@@ -33,6 +33,14 @@
|
|||||||
<strong>Total Team Points Scored:</strong>
|
<strong>Total Team Points Scored:</strong>
|
||||||
<%= @wrestler.totalTeamPoints %>
|
<%= @wrestler.totalTeamPoints %>
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>Points Breakdown:</strong></br>
|
||||||
|
Pool Win Points (including BYE points): <%= @wrestler_points_calc.poolPoints %></br>
|
||||||
|
Bracket Win Points: <%= @wrestler_points_calc.bracketPoints %></br>
|
||||||
|
Bonus Points: <%= @wrestler_points_calc.bonusWinPoints %></br>
|
||||||
|
Placement Points:<%= @wrestler_points_calc.placementPoints %></br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user