# Restful table column sorting with pagination

**URL:** <https://www.ruby-forum.com/t/restful-table-column-sorting-with-pagination/84493>\
**Category:** Rails\
**Created:** [February 5, 2007, 10:46am UTC](https://www.ruby-forum.com/t/restful-table-column-sorting-with-pagination/84493 "2007-02-05T10:46:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@jkay](https://www.ruby-forum.com/u/jkay)\
**Post date:** [February 5, 2007, 10:46am UTC](https://www.ruby-forum.com/t/restful-table-column-sorting-with-pagination/84493/1 "2007-02-05T10:46:15Z")

</div>

Anyone able to implement table column sorting and pagination with  
Restful routes?

---

<div class="post-metadata">

**Author:** ![jkay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@jkay](https://www.ruby-forum.com/u/jkay)\
**Post date:** [February 9, 2007, 4:52am UTC](https://www.ruby-forum.com/t/restful-table-column-sorting-with-pagination/84493/2 "2007-02-09T04:52:47Z")

</div>

I’ll give it try and let you know what I come up with. Thanks!

---

<div class="post-metadata">

**Author:** ![jkay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@jkay](https://www.ruby-forum.com/u/jkay)\
**Post date:** [February 5, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/restful-table-column-sorting-with-pagination/84493/3 "2007-02-05T17:01:43Z")

</div>

On 2/5/07, Justin Ko [removed\_email\_address@domain.invalid](mailto: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](http://depixelate.com)
