mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-18 21:42:16 +00:00
Removed some logic from view for faster rendering
This commit is contained in:
@@ -39,6 +39,7 @@ class StaticPagesController < ApplicationController
|
|||||||
@tournament = Tournament.find(@weight.tournament_id)
|
@tournament = Tournament.find(@weight.tournament_id)
|
||||||
@matches = @tournament.upcomingMatches.select{|m| m.weight_id == @weight.id}
|
@matches = @tournament.upcomingMatches.select{|m| m.weight_id == @weight.id}
|
||||||
@wrestlers = Wrestler.where(weight_id: @weight.id)
|
@wrestlers = Wrestler.where(weight_id: @weight.id)
|
||||||
|
@pools = @weight.poolRounds(@matches)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<% until @matches.select{|m| m.round == @round}.blank? %>
|
<% until @matches.select{|m| m.round == @round}.blank? %>
|
||||||
<% if @round <= @weight.poolRounds(@matches) %>
|
<% if @round <= @pools %>
|
||||||
<th>R<%= @round %></th>
|
<th>R<%= @round %></th>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% @round = @round + 1 %>
|
<% @round = @round + 1 %>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<td><%= w.original_seed %> <%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
|
<td><%= w.original_seed %> <%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
|
||||||
<% @round = 1 %>
|
<% @round = 1 %>
|
||||||
<% until @matches.select{|m| m.round == @round}.blank? %>
|
<% until @matches.select{|m| m.round == @round}.blank? %>
|
||||||
<% if @round <= @weight.poolRounds(@matches) %>
|
<% if @round <= @pools %>
|
||||||
<td><%= w.boutByRound(@round,@matches) %><br>Result</td>
|
<td><%= w.boutByRound(@round,@matches) %><br>Result</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% @round = @round + 1 %>
|
<% @round = @round + 1 %>
|
||||||
|
|||||||
Reference in New Issue
Block a user