0

I am going to retrieve a list of objects.

get "/todoitems/?" do
  debugger
  todo = Todolist.all
  todo.to_json
end

Is there example that can retrieve page by page?

Many thanks.

TheOneTeam
  • 25,806
  • 45
  • 116
  • 158

2 Answers2

0

This should point you in the right direction:

http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-users#sec-pagination

Essentially, there's a gem called will-paginate that takes care of sorting things in a page by page structure. There's an example included in the link

Peter Berg
  • 6,006
  • 8
  • 37
  • 51
0

Here's a gem dm-pagination which provides pagination support for Datamapper

I also found dm-paginator

Mudassir Ali
  • 7,913
  • 4
  • 32
  • 60