Closed avra911 closed 9 years ago
It appears that doing cache in view directly works:
- cache("#{params['q']}/#{params['page']}") do
- @items.each do |item|
Any suggestion on best practice here? I just started ruby 3 weeks ago :)
Maybe I can cache the entire page (controller action) based on the params so it will work with pagination and search terms?
Probably you should cache results
Model.es.search({body:@body}, {page: page, per_page: per_page}).results.to_a
Hi,
I am doing a search and I am using kaminari as pagination
and view:
I was wonder how I can cache the
@items
, because just doing the same way as with standard model cache throws me an error (no _dump_data is defined for class Proc
):Should I move the cache directive to view instead of model search function definition?
Thanks in advanced, R