by agate - Published: 2008-08-23 [10:52 下午] - Category: 程序编码

"will_paginate" is a rails plugin for helping developer to create the pagination links. use it, you can very easily to make a nice pagination links.

usage:
It’s very easy to do pagination on ActiveRecord models:
cattr_reader :per_page
@@per_page = 5 #modify this

It’s also very easy to make a on Controller:
@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 %>

Homepage: http://github.com/mislav/will_paginate/wikis
Clone URL: git://github.com/mislav/will_paginate.git
Doc URL: http://mislav.caboo.se/static/will_paginate/doc/

Tags: [ , , ] - Comments: View Comments
blog comments powered by Disqus