0
这里是我的代码工作正常,但我想添加多个属性,即姓氏,城市等我如何在轨多重属性映射与searchkick宝石
def autocomplete
render json: Doctor.search(params[:query], autocomplete: true, limit: 10).map(&:first_name)
end
我希望下面的解释我的问题,你可能得到了我的观点,我可以使用下面的代码。
def autocomplete
render json: Doctor.search(params[:query], autocomplete: true, limit: 10).map(&:first_name, :last_name, :city, :country)
end
这里是你的答案:http://stackoverflow.com/questions/28643262/searchkick-autocomplete-with-multiple-attributes/28643845#28643845 –