# Reversing paginated lists, linking to last page from control

**URL:** <https://www.ruby-forum.com/t/reversing-paginated-lists-linking-to-last-page-from-control/52261>\
**Category:** Rails\
**Created:** [January 12, 2006, 10:05am UTC](https://www.ruby-forum.com/t/reversing-paginated-lists-linking-to-last-page-from-control/52261 "2006-01-12T10:05:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todd\_Yarling](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e36b37/32.png) [@Todd\_Yarling](https://www.ruby-forum.com/u/Todd_Yarling)\
**Post date:** [January 12, 2006, 10:05am UTC](https://www.ruby-forum.com/t/reversing-paginated-lists-linking-to-last-page-from-control/52261/1 "2006-01-12T10:05:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Todd\_Yarling](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e36b37/32.png) [@Todd\_Yarling](https://www.ruby-forum.com/u/Todd_Yarling)\
**Post date:** [January 12, 2006, 1:27pm UTC](https://www.ruby-forum.com/t/reversing-paginated-lists-linking-to-last-page-from-control/52261/2 "2006-01-12T13:27:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Todd\_Yarling](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e36b37/32.png) [@Todd\_Yarling](https://www.ruby-forum.com/u/Todd_Yarling)\
**Post date:** [January 12, 2006, 9:06pm UTC](https://www.ruby-forum.com/t/reversing-paginated-lists-linking-to-last-page-from-control/52261/3 "2006-01-12T21:06:17Z")

</div>

That did the trick, thanks
