Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leikind/6fd02d1fc66228a25cb3 to your computer and use it in GitHub Desktop.
Save leikind/6fd02d1fc66228a25cb3 to your computer and use it in GitHub Desktop.
:total_entries of will_paginate and WiceGrid

NOVEMBER 11, 2009

will_paginate normally runs 2 SQL queries - one to retrieve a limited number of records, and one to count all records. To avoid the second COUNT query one can submit parameter :total_entries to method paginate. Today :total_entries was also added to parameters of initialize_grid in order to be able to use this functionality of will_paginate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment