1

If I have a JSON data source (ex: http://marketplace.envato.com/api/edge/new-files:themeforest,site-templates.json), can I use will_paginate for pagination? I use HTTParty for the JSON so it doesn't go through ActiveRecord, that's the problem. How can I use HTTParty together with will_paginate without ActiveRecord?

tungsten_carbide
  • 525
  • 5
  • 18

1 Answers1

3

you can use will_paginate for array create array from json response just use
require 'will_paginate/array'
and

array.paginate(:page => 100, :per_page => 10)

Thank you

Rajarshi Das
  • 11,778
  • 6
  • 46
  • 74
  • It worked. I also found some other useful pages http://stackoverflow.com/questions/13187076/paginating-an-array-in-ruby-with-will-paginate#_=_ and http://stackoverflow.com/questions/4352895/ruby-on-rails-will-paginate-an-array – tungsten_carbide Aug 31 '13 at 03:37