From fcc1a6968c53634edce24a3fbd2b3619d8ed11c9 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Thu, 21 Feb 2013 21:36:33 -0500 Subject: [PATCH] lowercase in commons searching for topic names --- app/controllers/main_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 19b4252f..7d7061e6 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -22,7 +22,8 @@ class MainController < ApplicationController @synapses = Array.new() if params[:topics_by_name] != "" like_keyword = "%"+params[:topics_by_name]+"%" - @topics = Topic.where("name LIKE ?", like_keyword) + like_keyword.downcase! #convert to lowercase for better comparison + @topics = Topic.where("LOWER(name) LIKE ?", like_keyword) end if params[:topics_by_user_id] != "" @user = User.find(params[:topics_by_user_id])