Skip to content

Instantly share code, notes, and snippets.

@astashov
Created June 7, 2011 14:20
Show Gist options
  • Save astashov/1012345 to your computer and use it in GitHub Desktop.
Save astashov/1012345 to your computer and use it in GitHub Desktop.
will_paginate replacement
scope :paginate, lambda { |page, per_page| limit(per_page.to_i).offset((page.to_i - 1) * per_page.to_i) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment