My first thought was that if you could get the data into the same format as that returned from a database query (from memory, I think that is an array of hashes, with each hash representing a row of data; the hash keys matching the field names) then the answer would be yes.
However, I think the paginator works by modifying the SQL calls to pull only the rows for the current page. That is you don't pull all the data into the array and then paginate the array. Instead the SQL call is modified so that only a page worth of data is pulled from the database and used to populate the data array.
Therefore, I think your best bet is to dig into the Rails code and work through the pagination methods to see how they work, and build you own version based on them.
I am getting the data from response stream as a comma separated values not as hashes. I couldn't find the way to paginate with the data stream so i am temporary storing the data in the table just for the pagination. It's not the good way to do it..but couldn't find the better way of doing this..
Bookmarks