SQLServer and Paging
March 2nd, 2006 by papillon
Both the standard scaffold generator and my modified version of the AJAX scaffold support paging, i.e. displaying 10 items per page and allowing the user to flip through the pages with the usual first, last, next, previous links.
It does not work out of the box with SQL Server, unfortunately. You have to tell the driver explicitely that it should order the table by your primary key (id). Example:
@header_pages, @headers = paginate :headers, :per_page => 10, :order => ’id asc’