0

In my rails application i defined an array that i would like to use with the will_paginate gem. The array (arr) looks like this:

["/uploadsave/Emmanuel_4.png", "/uploadsave/Emmanuel_5.png", "/uploadsave/Emmanuel_6.png"..

In my controller i tried:

@arrems = arr.paginate(:page => params[:page], :per_page => 8)

But that provoces an error:

undefined method `paginate' for #<Array:0x75fb940>

So what can i do?

Em Sta
  • 1,676
  • 9
  • 29
  • 43

1 Answers1

1

Just put require 'will_paginate/array' at the top of any controllers that will use array pagination.

Tyler
  • 11,272
  • 9
  • 65
  • 105