I have had that problem as well. I thought I submitted a Ticket on this
one and it is the following:
The only way to get around this is to override the default scaffold
[which most would tell you to do any way], and add the following to your
@exterior_selection_pages, @exterior_selections = paginate
:exterior_selections, :per_page => 20, :order_by=>“id ASC”
Obviously substitute your object name for mine and your ID field as
well. I would submit another ticket on this as this only seems to
affect SQL Server.
Just curious do you have an ID column or did you override it?
From: firstname.lastname@example.org on behalf of Eric R.
Sent: Thu 12/22/2005 7:14 PM
Subject: [Rails] Abnormal Pagination Using SQL Server
I’m using RoR 1.0, Windows 2000, and SQL Server 2000. I am connecting to
the database using these directions:
Using the scaffold generator to generate the default files (ruby
script/generate scaffold Location) I start up WebBrick and pull up the
page. There are 58 records in the table. I am given the first 10
records. No problem so far. Then I click the next page link - which
points to page 2 (page=2). I am presented with the same 10 records with
the same ten links. This continues for three more “next page” clicks for
a total of fifty. Then the really confusing part… on the the fifth
click I am only given eight of the same records.
In other words, Rails seems to know how many records there are but only
seems to be able to display the first 10 (or however many per page it’s
set for). All other functions (edit, new, show, etc) appear to work
Any help would be appreciated.
Posted via http://www.ruby-forum.com/.
Rails mailing list