I'm having problem with such codes:
@var = Rails.cache.fecth "blah" do "blah blah" end @var.paginate(:page => params[:page], :per_page => 5)
Those codes will return an error such undefined method paginate for <#Array...>...
After doing quick search over the internet, I found this one is working for my case (should be working on yours too if you have same problem). You need to add this 1 line code at the top of your controller.
After adding that 1 line code, when running those codes before, it's working like a charm. If you don't want to load that will_paginate/array for the whole controller, you can add it at the top of the method where you run the paginate codes for Array (as shown above).