I need some help on how to implement a jquery-ui autocomplete in my Rails app.
I want to add autocompletion to a text field where the user can enter in a customer na
Dale's Answer is quite the tutorial. One thing to note is that using your first query, the datasource will only return matches beginning with the string you type. If you want search anywhere in the word, you need to change:
@people = Person.find(:all,:conditions =>
['given_name LIKE ?', "#{params[:term]}%"])
to
@people = Person.find(:all,:conditions =>
['given_name LIKE ?', "%#{params[:term]}%"])
(added an extra %
to the query)