will_paginate 3.0 is designed to take advantage of the new ActiveRecord::Relation
in Rails 3, so it defines paginate
only on relations by default. It can still work with an array, but you have to tell rails to require that part.
In a file in your config/initializers
(I used will_paginate_array_fix.rb
), add this
require 'will_paginate/array'
Then you can use on arrays
my_array.paginate(:page => x, :per_page => y)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…