rails3-jquery-autocomplete and writing own search query

荒凉一梦 提交于 2020-01-07 06:41:26

问题


This is my controller, where I use autocomplete gem. I am getting the error for this query:

SELECT  users.id, users.phone, first_name, last_name FROM "users"  WHERE (LOWER(users.phone) ILIKE '77%') ORDER BY users.phone ASC LIMIT 10):

ActiveRecord::StatementInvalid (PGError: ERROR:  function lower(integer) does not exist

My controller:

class CarsController < ApplicationController
  autocomplete :user, :phone

  ...
end

I would like to ask you, how can I do my own db query for autocomplete searching - I need to throw it the error above and I think there is no way to do else...

I got this error, when I deployed my app to Heroku.

来源:https://stackoverflow.com/questions/8675393/rails3-jquery-autocomplete-and-writing-own-search-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!