mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-02 21:24:25 +00:00
Modified wrestler show to show matches and team points scored
This commit is contained in:
@@ -79,7 +79,7 @@ class WrestlersController < ApplicationController
|
|||||||
private
|
private
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_wrestler
|
def set_wrestler
|
||||||
@wrestler = Wrestler.where(:id => params[:id]).includes(:tournament,:school,:weight).first
|
@wrestler = Wrestler.where(:id => params[:id]).includes(:tournament,:school,:weight,: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.
|
||||||
|
|||||||
@@ -12,16 +12,22 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>School:</strong>
|
<strong>School:</strong>
|
||||||
<%= School.find(@wrestler.school_id).name %>
|
<%= @wrestler.school.name %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>Weight:</strong>
|
<strong>Weight:</strong>
|
||||||
<%= Weight.find(@wrestler.weight_id).max %>
|
<%= @wrestler.weight.max %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>Original seed:</strong>
|
<strong>Team Points Scored:</strong>
|
||||||
<%= @wrestler.original_seed %>
|
<%= @wrestler.totalTeamPoints - @wrestler.totalDeductedPoints %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<% @wrestler.allMatches.each do |m| %>
|
||||||
|
<div> Bout: <%= m.bout_number %> <%= m.bracket_position %> <%= m.wrestler1.name %> vs. <%= m.wrestler2.name %> <%= m.bracketScore %></div>
|
||||||
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user