# SortHelper Question

**URL:** <https://www.ruby-forum.com/t/sorthelper-question/56520>\
**Category:** Rails\
**Created:** [March 31, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/sorthelper-question/56520 "2006-03-31T20:59:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lloyd\_Christmas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/7bcc69/32.png) [@Lloyd\_Christmas](https://www.ruby-forum.com/u/Lloyd_Christmas)\
**Post date:** [March 31, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/sorthelper-question/56520/1 "2006-03-31T20:59:03Z")

</div>

I’m trying to install the SortHelper module, and for some reason I’m  
getting a NoMethodError when I try to view the list. I’m a relative  
newbie to rails, but the controller and the helper seem to be pointing  
to the right places. I named the controller sort\_controller.rb and the  
helper is sort\_helper.rb, and list is list.rhtml

Thanks for any help!

* * *

Join Excite! - [http://www.excite.com](http://www.excite.com)  
The most personalized portal on the Web!

---

<div class="post-metadata">

**Author:** ![Lloyd\_Christmas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/7bcc69/32.png) [@Lloyd\_Christmas](https://www.ruby-forum.com/u/Lloyd_Christmas)\
**Post date:** [April 1, 2006, 12:51am UTC](https://www.ruby-forum.com/t/sorthelper-question/56520/2 "2006-04-01T00:51:25Z")

</div>

Lloyd Christmas \<plant\_life@…\> writes:

> I’m trying to install the SortHelper module, and for some reason I’m getting  
> a NoMethodError when I try to  
> view the list. I’m a relative newbie to rails, but the controller and the  
> helper seem to be pointing to the  
> right places. I named the controller sort\_controller.rb and the helper is  
> sort\_helper.rb, and list is list.rhtml

Typically, helpers are referenced in controllers where you want to  
invoke them,  
rather than in their own controller. You utilize the helper, in this  
case the  
sort helper, by sticking a “helper :sort” at the top of the controller.

For example, if you have a controller that generates a collection of  
“Widget”  
models that you want to sort in the list view, you would put this at the  
top of  
widget\_controller.rb…

helper :sort  
include SortHelper

…and then you would get all the methods provided by the sort\_helper.rb  
module. I got bit by this myself, hopefully this will solve your issue  
too.
