Skip to content

Instantly share code, notes, and snippets.

@knicklabs
Created January 30, 2011 05:13
Show Gist options
  • Save knicklabs/802565 to your computer and use it in GitHub Desktop.
Save knicklabs/802565 to your computer and use it in GitHub Desktop.
How to use the will paginate plugin to paginate items
# Add the Will Paginate plugin to the gemfile
gem 'will_paginate', '3.0.pre2'
# Place this code in the controller
@items = Item.all.paginate(:page => params[:page] || 1, :per_page => 10)
# Place this code in the view
<%= will_paginate @items %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment