Peter Fitzgibbons
3/28/2005 5:32:00 PM
Hello,
I have pagination set up on my controller.
View template list.html and def list end on the controller. :per-page =
20
Browsing the template works, pagination page selector updates
appropriately to the page= url parameter, but the records retrieved are
always the first 20 records of the entire table. It doesn't offset for
each paginated page?
>8 >8 >8 excel_commission_controller.rb >8 >8 >8
class ExcelCommissionController < ApplicationController
model :excel_commission
scaffold :excel_commission
paginate :excel_commissions, :order_by => 'file_name, row_id',
:per_page => 20
def list
end
end
8< 8< 8< excel_commission_controller.rb 8< 8< 8<
>8 >8 >8 list.rhtml >8 >8 >8
<html>
<head>
<title>Excel Data</title>
</head>
<body>
<%= render_partial "paginator_navigate",
@excel_commission_pages %>
<BR>
<%= render_partial "paginator_display",
@excel_commission_pages %>
<br>
<% @excel_commissions.each do |@item| %>
<%= @item.file_name %><%= @item.row_id %><br>
<% end %>
</body>
</html>
8< 8< 8< list.rhtml 8< 8< 8<
Peter J. Fitzgibbons
Applications Manager
Lakewood Homes - "The American Dream Builder"(r)
Peter.Fitzgibbons@Lakewoodhomes.net
(847) 884-8800