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.
Justin K. (Guest)
on 2007-02-05 11:46
Anyone able to implement table column sorting and pagination with
Restful routes?
Zack C. (Guest)
on 2007-02-05 18:01
(Received via mailing list)
On 2/5/07, Justin Ko <removed_email_address@domain.invalid> 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 C.
http://depixelate.com
jko170 (Guest)
on 2007-02-09 05: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.