Links
Will Paginate
Categories
Will Paginate
Pagination is just limiting the number of records displayed. Why should you let it get in your way while developing, then? This plugin makes magic happen. Did you ever want to be able to do just this on a model:
Post.paginate :page => 1, :order => 'created_at DESC'
… and then render the page links with a single view helper? Well, now you can.
Some resources to get you started:
- Your mind reels with questions? Join our Google group[http://groups.google.com/group/will_paginate].
- The will_paginate project page: http://github.com/mislav/will_paginate
- How to report bugs: http://github.com/mislav/will_paginate/wikis/report-bugs
- Ryan Bates made an awesome screencast[http://railscasts.com/episodes/51], check it out.
Example usage
Use a paginate finder in the controller:
@posts = Post.paginate_by_board_id @board.id, :page => params[:page], :order => 'updated_at DESC'
Yeah, paginate works just like find — it just doesn’t fetch all the records. Don’t forget to tell it which page you want, or it will complain! Read more on WillPaginate::Finder::ClassMethods.
Render the posts in your view like you would normally do. When you need to render pagination, just stick this in:
<%= will_paginate @posts %>
You’re done.
Vitals
| Home | http://github.com/mislav/will_paginate/tree/master |
|---|---|
| Repository | git://github.com/mislav/will_paginate.git |
| License | Rails' (MIT) |
| Tags |
_these_tags_are_awful aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaqsd activerecord balls_of_steel big-j-coming-through boobvillage cvcvsdfasf DORK_MOUTH_EAT_HAM_BAG fhgj fuck fuck_your_couch fucking gakkerenbanget hihihih hihihihi hihihihih hihihihihihih hihihihihihihihihihihihihi Houston_we_have_a_problem ihih joe-peck-in-the-mfing-house loljews lynn mod_thy_tags page pages paginate pagination pagniate sdfssdsdfsdfsdfsdfsdfsdfsdfsdf sdssdsdsdf Sex sfsgsgsgssgsssssssgsgsggssgsgsgsgsgsgsdsgsgsgsgsgsdsdgsdsdgsdggs sis sistemTagIniHarusDiperbaikiDong ssdsdfsdfsdfsdf testing thing THIS_FUCKING_DIAPER_BAG_SMELLS_LIKE_SHIT will will_paginate yes you_smell_like_shit
|
| Rating | (182 votes) |
| Owner | Mislav Marohnić |
| Created | 14 February 2007 |
Comments
-
great plugin. great documentation--clarity and wit! who could ask for more?
-
You can use willpaginate within Liquid templates with the willpaginateliquidized plugin: http://agilewebdevelopment.com/plugins/willpaginate_liquidized
-
RSS feed on will_paginate source repository commits: http://codenotifier.com/projects/10.rss
-
It's very useful plugin, easy to integrate with Ferret. OT: you should clear tags for this plugin...
-
This plugin rocks. Thanks.
-
is there any simple line command to install it

