📜  will_paginate gem rails - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:47.795000             🧑  作者: Mango

代码示例1
## perform a paginated query:
@posts = Post.paginate(page: params[:page])

# or, use an explicit "per page" limit:
Post.paginate(page: params[:page], per_page: 30)

## render page links in the view:
<%= will_paginate @posts %>