diff options
-rw-r--r-- | app/controllers/request_controller.rb | 13 | ||||
-rw-r--r-- | app/views/request/list.rhtml | 4 |
2 files changed, 8 insertions, 9 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 007cef5d1..3b2719b5c 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -120,13 +120,12 @@ class RequestController < ApplicationController raise "unknown request list view " + @view.to_s end - #behavior_cache do - xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse') - @list_results = xapian_object.results.map { |r| r[:model] } - @matches_estimated = xapian_object.matches_estimated - - #end - #@page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect + @page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect + behavior_cache :tag => [@view, @page] do + xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse') + @list_results = xapian_object.results.map { |r| r[:model] } + @matches_estimated = xapian_object.matches_estimated + end @title = @title + " (page " + @page.to_s + ")" if (@page > 1) diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml index b059058cf..222bd938d 100644 --- a/app/views/request/list.rhtml +++ b/app/views/request/list.rhtml @@ -18,7 +18,7 @@ <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> <% end %> -<% # view_cache :ttl => 5.minutes do %> +<% view_cache :ttl => 5.minutes, :tag => [@view, @page] do %> <% if @list_results.empty? %> <p>No requests of this sort yet.</p> <% else %> @@ -32,7 +32,7 @@ <% end %> <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @matches_estimated) %> -<% # end %> +<% end %> <% if @track_thing %> <p></p> |