I'm using jQuery autocomplete in a few areas. It makes a call to this method:
def index
@schools = School.order(:name).where("name like ?", "%#{params[:term]}%").limit(10)
render json: @schools.map(&:name)
end
Initially I didn't handle case sensitivity well, so I have some duplicate names in differing cases (ie. "Rutgers" and "rutgers".
I'd like to change the above method to return only unique values, ignoring the case, so only one "Rutgers" result will be returned.
I'm going to clean up the DB but a quick temp fix for this would be great!