Forum: Ruby on Rails reversing paginated lists, linking to last page from control

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5f5f062a7c6b25c222e5d4ee155c3474?d=identicon&s=25 Todd Yarling (Guest)
on 2006-01-12 10:05
(Received via mailing list)
Hi

I use the scaffolded generated crud to handle my entries, and I cannot
figure out how to reverse the list, what with the pagination.

I can reverse the entries on a page, but not the entire paginated list.

Also, it would be helpful to me to be able to redirect to the last page
of a
paginated list when I destroy, i figured out how to add such links to
the
view, but how to get from the controller to the last page.

Especially the second way, so i can more easily destroy lots of stuff,
which
is what I really want to do.
C8a634a01a2c4508360874bff7fb1a7f?d=identicon&s=25 Kevin Olbrich (olbrich)
on 2006-01-12 13:27
Todd Yarling wrote:
> Hi
>
> I use the scaffolded generated crud to handle my entries, and I cannot
> figure out how to reverse the list, what with the pagination.
>
> I can reverse the entries on a page, but not the entire paginated list.
>
> Also, it would be helpful to me to be able to redirect to the last page
> of a
> paginated list when I destroy, i figured out how to add such links to
> the
> view, but how to get from the controller to the last page.
>
> Especially the second way, so i can more easily destroy lots of stuff,
> which
> is what I really want to do.

You should be able to 'reverse' your list by passing an
:order=>'some_column DESC' to the paginate function.

_Kevin
5f5f062a7c6b25c222e5d4ee155c3474?d=identicon&s=25 Todd Yarling (Guest)
on 2006-01-12 21:06
(Received via mailing list)
That did the trick, thanks
This topic is locked and can not be replied to.