# Sort Helper2 for column header sorting

**URL:** <https://www.ruby-forum.com/t/sort-helper2-for-column-header-sorting/117859>\
**Category:** Rails\
**Created:** [October 21, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/sort-helper2-for-column-header-sorting/117859 "2007-10-21T18:19:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LAB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@LAB](https://www.ruby-forum.com/u/LAB)\
**Post date:** [October 21, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/sort-helper2-for-column-header-sorting/117859/1 "2007-10-21T18:19:15Z")

</div>

I’ve been using SortHelper2 ([http://wiki.rubyonrails.org/rails/pages/](http://wiki.rubyonrails.org/rails/pages/)  
SortHelper2) to help with column header sorting in a table. The  
problem is, it only seems to work in the LIST action/view for any  
controller. I want to use the sorting helpers in my search\_results  
view page. When I try to add it there, I get errors:

The error occurred while evaluating nil.[]  
#{RAILS\_ROOT}/app/helpers/sort\_helper.rb:53:in `sort\_link’

It looks like the “/list” part of the URL is hardcoded in somewhere,  
when building the link in the “sort\_link” function. How can I change  
this, and if I do change this to say “search\_results”, will it even  
work?

Any suggestions appreciated!!

LAB
