lowercase in commons searching for topic names

This commit is contained in:
Devin Howard 2013-02-21 21:36:33 -05:00
parent a248a866c1
commit fcc1a6968c

View file

@ -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])