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.
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.
这是一个为 Datamapper 提供分页支持的 gem dm-pagination
我还找到了dm-paginator
这应该为您指明正确的方向:
http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-users#sec-pagination
本质上,有一个名为will-paginate的 gem ,它负责按页面结构对页面中的内容进行排序。链接中包含一个示例