will_paginate用法

在controller下
@products = Product.paginate :page => params[:page] || 1, :per_page => 1


在view页面上
<%= will_paginate @products, :prev_label => '上一页', :next_label => '下一页' %>

共  @products.total_entries  条记录

你可能感兴趣的:(java)