From 91ba2923060c9ec07f349bb82fbfaa89a38531dc Mon Sep 17 00:00:00 2001 From: jcwimer Date: Wed, 13 Jan 2016 16:05:40 +0000 Subject: [PATCH] Fixed caching for wrestler and school show pages --- app/views/schools/show.html.erb | 5 +++-- app/views/wrestlers/show.html.erb | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/schools/show.html.erb b/app/views/schools/show.html.erb index 0028dec..c56963f 100644 --- a/app/views/schools/show.html.erb +++ b/app/views/schools/show.html.erb @@ -36,6 +36,7 @@ <% end %>

+ @@ -51,7 +52,7 @@ <% @wrestlers.sort_by{|w| w.weight.max}.each do |wrestler| %> - <% if wrestler.school_id == @school.id %> + <% cache ["schools_view_wrestler", wrestler] do %> @@ -63,6 +64,7 @@ Yes <% end %> + <% end %> - <% end %> <% end %>
<%= wrestler.name %> <%= wrestler.weight.max %> <%= wrestler.nextMatchBoutNumber %> <%= wrestler.nextMatchMatName %> <%= link_to 'Show', wrestler , :class=>"btn btn-default btn-sm" %> <% if can? :manage, wrestler.school %> @@ -71,7 +73,6 @@ <% end %>
diff --git a/app/views/wrestlers/show.html.erb b/app/views/wrestlers/show.html.erb index c74b305..24794ba 100644 --- a/app/views/wrestlers/show.html.erb +++ b/app/views/wrestlers/show.html.erb @@ -5,6 +5,7 @@ <% if can? :manage, @school %> | <%= link_to "Edit #{@wrestler.name}", edit_wrestler_path(@wrestler), :class=>"btn btn-primary" %> <% end %> +<% cache ["wrestlers", @wrestler] do %>

@@ -44,3 +45,4 @@ <% @wrestler.deductedPoints.each do |w| %>

Deducted points: <%= w.points %>
<% end %> +<% end %> \ No newline at end of file