# SortHelper problem

**URL:** <https://www.ruby-forum.com/t/sorthelper-problem/110728>\
**Category:** Rails\
**Created:** [July 30, 2007, 11:04am UTC](https://www.ruby-forum.com/t/sorthelper-problem/110728 "2007-07-30T11:04:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nanouk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@nanouk](https://www.ruby-forum.com/u/nanouk)\
**Post date:** [July 30, 2007, 11:04am UTC](https://www.ruby-forum.com/t/sorthelper-problem/110728/1 "2007-07-30T11:04:41Z")

</div>

I have TableA with name, description, start time displayed on one page.

TableB has name, comment, file path and is displayed on another page.

I’m using the SortHelper2 helper to help me sort the columns of these  
tables, however I’m experiencing a problem whereby if I sort TableA by  
description and then go ahead and view TableB I get an error message  
saying SQL Command Failed, Invalid column name ‘description’.

This is obviously because SortHelper is remembering the last chosen  
column to sort by, and the description column doesn’t exist in TableB.

So is SortHelper only designed to assist with sorting just the one table  
per application (which seems silly to me), or am I missing something  
here?

I’ve had a quick search on SortHelper and posts are few and far between,  
so if someone can suggest an alternative sorting plugin/helper instead  
please go ahead!

---

<div class="post-metadata">

**Author:** ![nanouk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@nanouk](https://www.ruby-forum.com/u/nanouk)\
**Post date:** [July 30, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/sorthelper-problem/110728/2 "2007-07-30T18:22:11Z")

</div>

> This is obviously because SortHelper is remembering the last chosen  
> column to sort by, and the description column doesn’t exist in TableB.
> 
> So is SortHelper only designed to assist with sorting just the one table  
> per application (which seems silly to me), or am I missing something  
> here?

On the SortHelper2 page there’s a snippet at the bottom where the dev  
mentions multiple tables and how to get the code to do them.

“I have modified this to work with sorting on multiple tables. Email  
me if you need the code, don’t feel like cleaning it up if no one  
wants it.  
([Oregon State University](http://oregonstate.edu/tools/mailform?osu=43568971303&recipient=George+Harkin))  
-George”

[http://wiki.rubyonrails.org/rails/pages/SortHelper2](http://wiki.rubyonrails.org/rails/pages/SortHelper2)

---

<div class="post-metadata">

**Author:** ![nanouk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@nanouk](https://www.ruby-forum.com/u/nanouk)\
**Post date:** [August 3, 2007, 12:00am UTC](https://www.ruby-forum.com/t/sorthelper-problem/110728/3 "2007-08-03T00:00:29Z")

</div>

Hi Paul,

I’ve posted my update to the SortHelper online:  
[http://montanaharkin.net/2007/08/02/rails-sorthelper2-multiple-table-coumn-sorting/](http://montanaharkin.net/2007/08/02/rails-sorthelper2-multiple-table-coumn-sorting/)

Cheers,  
George

On Jul 31, 1:30 am, Paul N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![nanouk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@nanouk](https://www.ruby-forum.com/u/nanouk)\
**Post date:** [July 31, 2007, 10:30am UTC](https://www.ruby-forum.com/t/sorthelper-problem/110728/4 "2007-07-31T10:30:23Z")

</div>

Chuck V. wrote:

> > This is obviously because SortHelper is remembering the last chosen  
> > column to sort by, and the description column doesn’t exist in TableB.
> > 
> > So is SortHelper only designed to assist with sorting just the one table  
> > per application (which seems silly to me), or am I missing something  
> > here?
> 
> On the SortHelper2 page there’s a snippet at the bottom where the dev  
> mentions multiple tables and how to get the code to do them.
> 
> “I have modified this to work with sorting on multiple tables. Email  
> me if you need the code, don’t feel like cleaning it up if no one  
> wants it.  
> ([Oregon State University](http://oregonstate.edu/tools/mailform?osu=43568971303&recipient=George+Harkin))  
> -George”
> 
> [http://wiki.rubyonrails.org/rails/pages/SortHelper2](http://wiki.rubyonrails.org/rails/pages/SortHelper2)

Yes, i have tried that. Unfortunately the mail gets bounced back.

Fortunately i’ve found an alternative. Thanks anyway.
