diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index c0562a9..0123134 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -39,6 +39,7 @@ class StaticPagesController < ApplicationController @tournament = Tournament.find(@weight.tournament_id) @matches = @tournament.upcomingMatches.select{|m| m.weight_id == @weight.id} @wrestlers = Wrestler.where(weight_id: @weight.id) + @pools = @weight.poolRounds(@matches) end end diff --git a/app/views/static_pages/_pool.html.erb b/app/views/static_pages/_pool.html.erb index a435923..209239f 100644 --- a/app/views/static_pages/_pool.html.erb +++ b/app/views/static_pages/_pool.html.erb @@ -7,7 +7,7 @@ Name <% until @matches.select{|m| m.round == @round}.blank? %> - <% if @round <= @weight.poolRounds(@matches) %> + <% if @round <= @pools %> R<%= @round %> <% end %> <% @round = @round + 1 %> @@ -20,7 +20,7 @@ <%= w.original_seed %> <%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %> <% @round = 1 %> <% until @matches.select{|m| m.round == @round}.blank? %> - <% if @round <= @weight.poolRounds(@matches) %> + <% if @round <= @pools %> <%= w.boutByRound(@round,@matches) %>
Result <% end %> <% @round = @round + 1 %>