jquery - Chang autocomplete-rails to search on all parts of string instead of just the beginning -
i've got autocomplete fields i'd user able enter part of search term correct result. example, if type "ang", they'd angel , los angeles. tried changing source array here no luck:
$.widget( "ui.autocomplete", { version: "1.10.2", defaultelement: "<input>", options: { appendto: null, autofocus: false, delay: 300, minlength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: array,
do need make change somewhere in autocomplete-rails.js file? help.
i think need change on rails end of things, since pattern matching won't readily available client side. imagine need override method autocomplete uses find results use more like
city.where('name = ?, ["%#{params[:name]}"])
i'm not expert in sql, idea.
Comments
Post a Comment