I'm trying to implement autocomplete functionality available in Jquery-ui, as part of this railscast. Ideally, I should end up with something that looks like this github repo.
But I'm having trouble with a coffeescript file that's related a resource named "contacts."
#app/assets/javascripts/contacts.js.coffee
jQuery ->
$('#search').autocomplete
source: "/search_suggestions"
When I run this code in the browser's console, it works. But when it's in the coffeescript file it doesn't. The file loads in the browser. It just doesn't run the code.
What am I doing wrong?