mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-16 13:03:37 +00:00
Cache team scores
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
class School < ActiveRecord::Base
|
class School < ActiveRecord::Base
|
||||||
belongs_to :tournament
|
belongs_to :tournament, touch: true
|
||||||
has_many :wrestlers, dependent: :destroy
|
has_many :wrestlers, dependent: :destroy
|
||||||
has_many :deductedPoints, through: :wrestlers
|
has_many :deductedPoints, through: :wrestlers
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,24 @@
|
|||||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" , :class=>"btn btn-default"%>
|
<% cache ["team_scores", @tournament] do %>
|
||||||
<br>
|
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" , :class=>"btn btn-default"%>
|
||||||
<br>
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
<h3>Team Scores</h3>
|
<h3>Team Scores</h3>
|
||||||
<table class="table table-striped table-bordered">
|
<table class="table table-striped table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
|
||||||
<th>Name</th>
|
|
||||||
<th>Score</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<% @schools.each do |school| %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= school.name %></td>
|
<th>Name</th>
|
||||||
<td><%= school.pageScore %></td>
|
<th>Score</th>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
</thead>
|
||||||
</tbody>
|
|
||||||
</table>
|
<tbody>
|
||||||
|
<% @schools.each do |school| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= school.name %></td>
|
||||||
|
<td><%= school.pageScore %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<% end %>
|
||||||
Reference in New Issue
Block a user