# Allowing users to reorder displayed data from a table

**URL:** <https://www.ruby-forum.com/t/allowing-users-to-reorder-displayed-data-from-a-table/64524>\
**Category:** Rails\
**Created:** [August 9, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/allowing-users-to-reorder-displayed-data-from-a-table/64524 "2006-08-09T19:31:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cheri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a5b964/32.png) [@Cheri](https://www.ruby-forum.com/u/Cheri)\
**Post date:** [August 9, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/allowing-users-to-reorder-displayed-data-from-a-table/64524/1 "2006-08-09T19:31:39Z")

</div>

I have a list of names and prices from a database to display on a  
webpage. I would like to allow the user to be able to display those  
items either alphabetically or by price (decending or ascending.) I  
would also like the user to be able to list items with a certain price  
range of their choosing also. How can I do this in Rails?

Thanks!

---

<div class="post-metadata">

**Author:** ![Cheri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a5b964/32.png) [@Cheri](https://www.ruby-forum.com/u/Cheri)\
**Post date:** [August 9, 2006, 9:10pm UTC](https://www.ruby-forum.com/t/allowing-users-to-reorder-displayed-data-from-a-table/64524/2 "2006-08-09T21:10:40Z")

</div>

Cheri wrote:

> I have a list of names and prices from a database to display on a  
> webpage. I would like to allow the user to be able to display those  
> items either alphabetically or by price (decending or ascending.) I  
> would also like the user to be able to list items with a certain price  
> range of their choosing also. How can I do this in Rails?
> 
> Thanks!

Look for a helper called “sort\_helper” - it works great for sorting on  
column headings.

The price range will have to be coded into a find criteria. Do the  
sort\_helper first because you will have to modify the search/find code  
after you implement it.

Regards,

Michael
