I am developing an autocomplete form using JQuery and Rails. However I don't know how to pull values from my database to JQuery (I believe this has to be done via Rails).
This is my autocomplete function in jQuery
<script>
$(document).ready(function() {
$( "#BOOKSEARCH" ).autocomplete({
source: programmingLang
});
});
var programmingLang = ["ActionScript","AppleScript","Asp","BASIC","C","C++",
"Clojure","COBOL","ColdFusion","Erlang","Fortran","Groovy","Haskell",
"Java","JavaScript","Lisp","Perl","PHP","Python","Ruby","Scala","Scheme"];
</script>
However at the moment the autocomplete fills from a hard coded array. How can a fill this array with my data values from rails?
Thanks