I have an array @level1 which looks like this :
[[3.0, 4, 2], [2.0, 48, 3], [2.1, 56, 4], ............]
I want to apply pagination on this
Sure, you can use WillPaginate::Collection to construct arbitrary pagination across collections. Assuming an array called values:
@values = WillPaginate::Collection.create(current_page, per_page, values.length) do |pager|
pager.replace values
end
You can then treat @values just like any other WillPaginate collection, including passing it to the will_paginate view helper.