在controller下
在view页面上
@products = Product.paginate :page => params[:page] || 1, :per_page => 1
在view页面上
<%= will_paginate @products, :prev_label => '上一页', :next_label => '下一页' %>
共 @products.total_entries 条记录