Pagination question

Discussion in 'Ruby' started by SSpalding (sent by Nabble.com), Jul 19, 2006.

  1. 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.html#a5392446
    Sent from the ruby-talk forum at Nabble.com.
    SSpalding (sent by Nabble.com), Jul 19, 2006
    #1
    1. Advertising

  2. SSpalding (sent by Nabble.com)

    Paul Battley Guest

    On 19/07/06, SSpalding (sent by 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/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.
    Paul Battley, Jul 19, 2006
    #2
    1. Advertising

  3. SSpalding (sent by Nabble.com), Jul 19, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joseph D. DeJohn

    DataGrid Pagination

    Joseph D. DeJohn, Jul 4, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    4,368
    Daniel Bass
    Jul 4, 2003
  2. Sreejumon[MVP]

    Re: datagrid custom pagination

    Sreejumon[MVP], Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    410
    Sreejumon[MVP]
    Jul 8, 2003
  3. Child
    Replies:
    0
    Views:
    325
    Child
    Aug 19, 2003
  4. Kruq

    DataList pagination

    Kruq, Apr 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    611
  5. =?Utf-8?B?UkI=?=
    Replies:
    2
    Views:
    2,275
    =?Utf-8?B?UkI=?=
    Oct 14, 2004
Loading...

Share This Page