1

如果我有 JSON 数据源(例如:http ://marketplace.envato.com/api/edge/new-files:themeforest,site- templates.json),我可以使用 will_paginate 进行分页吗?我对 JSON 使用 HTTParty,所​​以它不会通过 ActiveRecord,这就是问题所在。如何在没有 ActiveRecord 的情况下将 HTTParty 与 will_paginate 一起使用?

4

1 回答 1

3

您可以使用仅使用will_paginate和 创建 array数组json response
require 'will_paginate/array'

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

谢谢

于 2013-08-28T06:21:14.930 回答