Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

will_paginate

> 后端框架
Open source

Pagination library for Rails and other Ruby applications

5.7K stars0 likes0 views
WebsiteGitHub

About

Pagination library for Rails and other Ruby applications

will_paginate

will_paginate is a pagination library that integrates with Ruby on Rails, Sinatra, Hanami::View, and Sequel.

ruby
gem 'will_paginate', '~> 4.0'

See installation instructions on the wiki for more info.

ℹ️ will_paginate is now in maintenance mode and it will not be receiving new features. See alternatives

Basic will_paginate use

ruby
## 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 %>

And that's it! You're done. You just need to add some CSS styles to make those pagination links prettier.

You can customize the default "per_page" value:

ruby
# for the Post model
class Post
  self.per_page = 10
end

# set per_page globally
WillPaginate.per_page = 10

New in Active Record 3:

ruby
# paginate in Active Record now returns a Relation
Post.where(published: true).paginate(page: params[:page]).order(id: :desc)

# the new, shorter page() method
Post.page(params[:page]).order(created_at: :desc)

See the wiki for more documentation. Report bugs on GitHub.

Happy paginating.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rubypaginationpagination-librarypluginrails

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架