My autocomplete method searches only on the last_name column but I'd like for it to search first_name and last_name for a match. Basically how gmail and yahoo mail beta does it. I tried the sql OR operator but I can't get it to work.
def autocomplete search = params[:user] @users = User.find(:all, :conditions => [ 'LOWER(last_name) LIKE ?', '%' + search.downcase + '%' ], :order => 'last_name ASC', :limit => 8) unless search.blank? render :partial => "search" end
Thanks for any help!