Forum: Ruby on Rails Restful table column sorting with pagination

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.
6ce7537a93c6e45469b745b9f5ec7524?d=identicon&s=25 Justin Ko (jko170)
on 2007-02-05 10:46
Anyone able to implement table column sorting and pagination with
Restful routes?
C4dc94c893471878a105761a9207f29b?d=identicon&s=25 Zack Chandler (Guest)
on 2007-02-05 17:01
(Received via mailing list)
On 2/5/07, Justin Ko <rails-mailing-list@andreas-s.net> wrote:
>
> Anyone able to implement table column sorting and pagination with
> Restful routes?

I haven't implemented this but I don't see it being too difficult.
You could add a sort route to the resource's collection methods.

Example:

map.resources :items, :collection => { :sort => :post }

Then you could pass the attribute and page numbers as simple params.

Example:

/items;sort?on=name&p=2

I'm sure there are a bunch of other ways to do it.  It just depends on
how you want it to work.

Hope this helps.

--
Zack Chandler
http://depixelate.com
1df9fc8ddf084661265bbae74a8d0b43?d=identicon&s=25 jko170 (Guest)
on 2007-02-09 04:52
(Received via mailing list)
I'll give it try and let you know what I come up with. Thanks!
This topic is locked and can not be replied to.