Todd Yarling
2006-Jan-12 09:04 UTC
[Rails] reversing paginated lists, linking to last page from controller
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. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/a1ae8aef/attachment.html
Kevin Olbrich
2006-Jan-12 12:27 UTC
[Rails] Re: reversing paginated lists, linking to last page from con
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/.
Todd Yarling
2006-Jan-12 19:14 UTC
[Rails] Re: reversing paginated lists, linking to last page from con
That did the trick, thanks On 1/12/06, Kevin Olbrich <kevin.olbrich@duke.edu> wrote:> > 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/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/8126288f/attachment.html