[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Pagination question

Chris G (sent by Nabble.com)

7/19/2006 8:22:00 AM


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.
--
View this message in context: http://www.nabble.com/Pagination-question-tf1965053.htm...
Sent from the ruby-talk forum at Nabble.com.


2 Answers

Paul Battley

7/19/2006 8:33:00 AM

0

On 19/07/06, SSpalding (sent by Nabble.com) <lists@nabble.com> wrote:
> 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/Howto...

> 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 ":order => '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.

Chris G (sent by Nabble.com)

7/19/2006 8:43:00 AM

0


Ah, thanks so much. That I am, sorry about that.
--
View this message in context: http://www.nabble.com/Pagination-question-tf1965053.htm...
Sent from the ruby-talk forum at Nabble.com.