title: Chaining searching and sorting together in rails using serachlogic
body: <p>My code is very similar to that in <a href="http://railscasts.com/episodes/240-search-sort-paginate-with-ajax" rel="nofollow">railscasts #240</a></p>
  
  <p>The differences are that I am using rails 2.3.10 so I am not using 'where'.  Instead I am using serachlogic and my model looks like this...</p>
  
  <pre><code>//Model.rb
  def self.search(search)
        if search
          Model.column_name_like(search)
        else
          find(:all)
        end
      end
  </code></pre>
  
  <p>(I am using search logic because I need case insensitivity because I am deploying to heroku(postgres))</p>
  
  <p>When I try and chain my methods together like in the railscast and in other tutorials I get an error such as "method order not found"</p>
  
  <p>My controller is here...</p>
  
  <pre><code> @objects=Model.search(params[:search]).order(sort_order('created_at'))
  </code></pre>
  
  <p>This is with a slightly different column sort method which was working for me before I stuck the search in.</p>
  
  <p>Why does this method work in some tutorials but throwing an error in this case.  Is it because the tutorials are in rails 3?  </p>