Q:

will pagination - passing in an array variable

I have a very specific list of items I'd like to paginate.
Up to now, I've been doing
@company = Company.paginate( :page => params[:page], 
                               :conditions => ["activated=1... etc..."],
                               :per_page => 6,
                               :order => order_by)

But I'd like to create my own array @company that wouldn't be possible to retrieve through a single query.. and then paginate that. How can I pass the raw array to will_paginate?
Thank you...

A:

When loaded, will_paginate extends all arrays with the paginate method:
ruby-1.9.2-p180 :014 > [].respond_to?(:paginate)
=> true 

You can just create your array instance however you want and call paginate on it.

