I am trying to do an autocomplete from jQuery, however the code that I have is in CoffeeScript. I am not to sure how to run it on my localhost server.
At first I placed it in application.js but that doesn't work, so then I created gens.js.coffee and placed the code there, but still doesn't show.
Here is the code:
jQuery ->
$('#querysearch').autocomplete
source: ['foo', 'food', 'four']
Here application.js is calling the file:
//= require gens
//= require jQuery.ui.datepicker
# file his actually gens.js.coffee
This is how I call application.js:
<%= javascript_include_tag "application" %>
What I am doing wrong?
console.debug('yes, I'm here!');togens.js.coffeeand checked your browser console when loading the page? Said more directly: have you proven whether or notgens.js.coffeeis being included inapplication.js?gem "coffee-script"in yourGemfileand uncommented? Is the gem installed (did you runbundle installto ensure it's installed?)application.jsbuilt already? Runrake assets:cleanto clear out any precompiled copy.