Pagination question

  • Thread starter SSpalding (sent by Nabble.com)
  • Start date
S

SSpalding (sent by Nabble.com)

I can't seem to find the information I need about pagination.

It seems that by default the paginations scheme breaks things up from first
to last. Does anyone know how one would be able to paginate from the last
item entered to the first. the .reverse method only seems to reverse things
'within' the page.
 
P

Paul Battley

I can't seem to find the information I need about pagination.

Presumably you're talking about Ruby on Rails. Have you seen this?
http://wiki.rubyonrails.org/rails/pages/HowtoPagination
It seems that by default the paginations scheme breaks things up from first
to last. Does anyone know how one would be able to paginate from the last
item entered to the first. the .reverse method only seems to reverse things
'within' the page.

Assuming that you are talking about Rails, you just need to set the
appropriate order in the query. So, to get from the last item created
to the first, you could add ":eek:rder => 'id DESC'". If you want them in
ascending order *within* each page, then you need to call reverse on
the result of that.

Finally, there's a separate mailing list for Ruby *on Rails* - this is
a more general list (to which you are apparently posting via
nabble.com). For Rails-specific questions, you'll probably get better
response in the appropriate list.

Paul.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top