While using the command:
@items = Item.find(:all,:order => 'name', :conditions => ["name LIKE ?", "%#{params[:key]}%"])
This works perfectly fine, but the search is only based on just a column. How do i make it search other columns, like description, category?
I am assuming you are using Rails 2, since you are using ActiveRecord 2 style syntax. You can just add the other columns as additional conditions, like this:
For reference, here’s how you would do it in Rails 3: