Displaying 2 results from an estimated 2 matches for "order_pages".
2006 Jul 16
3
pagination over custom-sorted collections?
...lections of
items. I''m trying to sort the collection and then pass it, sorted, to
a Paginator, and still be able to paginate through the collection,
across several pages, with the new sort order. The only thing I''m
doing differently from the regular scaffolding approach is this:
@order_pages = Paginator.new(self, @orders.length, 10, (params[:page]
||= 1).to_i)
It doesn''t work.
@orders is sorted when I hand it to Paginator. Am I skipping a step?
Does Paginator only work on run-of-the-mill SQL calls? I can''t seem to
figure this out.
--
Giles Bowkett
http://www.giles...
2006 Feb 13
1
another simple question: per_page in pagination
Hi,
Why can''t I use a variable to specify the :per_page attribute when using
the most basic form of pagination? (if I use a hardcode number, it
runs) What did I do? Thx.
My code:
def list_orders
page_size = 20
...
order_pages, @orders = paginate(:orders, :per_page => page_size)
end
My Errors:
undefined method `>'' for false:FalseClass
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/
pagination.rb:...