public
Description: Adaptive pagination plugin for web frameworks and other applications
Home | Edit | New

Home

This is the official home for the will_paginate library. You can find will_paginate API documentation here.

The name of the will_paginate gem is now “mislav-will_paginate” because it’s being built by GitHub. If you have a gem named “will_paginate”, it is old and you are advised to remove it from your system.

Important: read about the backwards incompatibility in the next big, framework-agnostic release of will_paginate library.

Refer to installation instructions for more info. The gem is preferred method of installation; if you have the plugin in “vendor/plugins/will_paginate/” directory, it may be best to remove it and simply configure your application to load the gem.

Basics

It’s very easy to do pagination on ActiveRecord models:

@posts = Post.paginate :page => params[:page], :order => 'created_at DESC'

In the view, page links can be rendered with a single view helper:

<%= will_paginate @posts %>

Resources

Also on GitHub:

The plugin officially supports Rails versions 1.2.6 up to 2.3.2. Databases supported should be all which have ActiveRecord adapters; the test suite covers MySQL, PostgreSQL and SQLite3.

Last edited by troelskn, Wed Jul 22 02:32:54 -0700 2009
Home | Edit | New
Versions: