I add the this line in my .slim file:
= paginate cookies.permanent[:gyms].split('#').reverse, window: 1
Then, I get this error. So some configurations there I need write?
I know it is about kaminari gem. And There has no model about cookies.
And the log info is:
Completed 500 Internal Server Error in 137ms (ActiveRecord: 0.0ms)
ActionView::Template::Error (undefined method `total_pages' for #<Array:0x007f7d750d02d8>):
25: = link_to gym.split('+')[1] do
26: = gym.split('+')[3]
27: - temp_arr = cookies.permanent[:gyms].split('#').reverse
28: = paginate temp_arr, window: 1
29: //= render partial: "layouts/sidebar"
app/views/statics/history.html.slim:28:in `_app_views_statics_history_html_slim__1135090183647085502_70088407005100'
app/controllers/statics_controller.rb:168:in `history'
You're using an Array
so you should use Kaminari.paginate_array
method:
https://github.com/kaminari/kaminari#paginating-a-generic-array-object