Paginating an Array in Ruby with will_paginate -


I have an array @ level 1 which looks like this:

  [ 3.0, 4, 2], [2.0, 48, 3], [2.1, 56, 4], ............]   

on the page This array displays the number of lines in each page only once. I tried to do this:

  @ temp1 = @ level1.paginate (: page => parameter [: page])   

but it The following error throws: [0, 4, 2], [2.0, 48, 3], [2.1, 56, 4]]: array

  undefined method 'paged' Previous> 

How can I paginate on page I_paginate?

Sure, you can mark arbitrary page in willfgnnet :: archive archives For making. Assuming an array named value :

  @values ​​= WillPaginate :: archive .create (current_page, per_page, values.length) do | Pager | Pager.replace values ​​can end   

you can treat @values ​​, such as any other dissolving archive, in which it will be will_paginate View Assistant

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -