[Rails] Re: reversing paginated lists, linking to last page from con

Kevin Olbrich kevin.olbrich at duke.edu
Thu Jan 12 12:27:05 GMT 2006


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

-- 
Posted via http://www.ruby-forum.com/.


More information about the Rails mailing list