My code is very similar to that in railscasts #240
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...
//Model.rb
def self.search(search)
if search
Model.column_name_like(search)
else
find(:all)
end
end
(I am using search logic because I need case insensitivity because I am deploying to heroku(postgres))
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"
My controller is here...
@objects=Model.search(params[:search]).order(sort_order('created_at'))
This is with a slightly different column sort method which was working for me before I stuck the search in.
Why does this method work in some tutorials but throwing an error in this case. Is it because the tutorials are in rails 3?