i am trying to do an autocomplete feature in rails using the jquery ui library. however i keep getting syntax errors \"Syntax Error: reserved word \"function\" on line ...\"
If you want to embed javascript within a coffeescript file, you can do so using backticks:
jQuery ->
`function abc() { return 123; } // js syntax here`
See here: http://coffeescriptcookbook.com/chapters/syntax/embedding_javascript
This is pretty confusing, though, so it is generally a better idea to convert the code to coffeescript, in which case you can use the js2coffee.org converter as DanS suggested.
Only the first line is coffeescript; the rest is normal javascript.
Try using this converter:
http://js2coffee.org/
$(function() {});
becomes $ ->