Sorting Helper issue

Hi Friends,

    I am very new to RoR. I have now got the pager working for my
listing page and was trying to get the sorting to work. However I get
this error:

MissingSourceFile in PeopleController#index
Missing helper file helpers/sorting_helper.rb
RAILS_ROOT: C:/ruby/contact

Application Trace | Framework Trace | Full Trace
helpers.rb:127:in `helper'
helpers.rb:111:in `each'
helpers.rb:111:in `helper'

  Following is the code in the controller:

  def index
    @sorter = self, %w(name address),
@params['sort'], @params['order'], 'name', 'ASC'
    @people =[:search], params[:page])

following is the code in the view:

<h1>Listing people</h1>

    <th><%= link_to 'Name', @sorter.to_link('name') %></th>
    <th><%= link_to 'Address', @sorter.to_link('address') %></th>

<% for person in @people %>
    <td><%=h %></td>
    <td><%=h person.address %></td>
    <td><%= link_to 'Show', person %></td>
    <td><%= link_to 'Edit', edit_person_path(person) %></td>
    <td><%= link_to 'Destroy', person, :confirm => 'Are you
sure?', :method => :delete %></td>
<% end %>

<br />

<!-- products/index.rhtml -->
<%= will_paginate @people %>

<%= link_to 'New person', new_person_path %>

following is the code in the model:

class Person < ActiveRecord::Base

# models/product.rb
def, page)
  paginate :per_page => 5, :page => page,
           :conditions => ['name like ?', "%#{search}%"],
           :order => 'name'


i also added this line to the routes.rb

  map.connect ':controller/:action/:sort/:order'

    Looking forward to your help yet again.....:slight_smile:

guys do i have to download and install any gem for this just like the
way i did for pagination?

have you install the plugin?

ruby script/plugin install

and dont forget to ensure that you install svn in your OS. Try to ask
google how to install SVN in your OS.


well i would prefer to install a gem rather than do it through the
plugin........, can anyone please tell me how to do that?