close
安裝
Edit Gemfile
gem 'will_paginate'
使用
Controller Code
Example
@posts = @board.posts.paginate(:page => params[:page], :per_page => 2 )
View Code
Example
<%= will_paginate @posts, :previous_label => '上頁', :next_label => '下頁', :page_links => true %>
Model Code
Example
class Post
self.per_page = 10
end
全站熱搜
留言列表