In our rails rfq.js.coffee, we only have a simple js code:
$(function() {
$(\'#need_report\').change(function(){
if ($(this).val() == true) {
$(\
You can't use standard JS like that in a Coffeescript file. Either rename the file to rfq.js
, or convert it to coffeescript:
$ ->
$('#need_report').change ->
if $(this).val()
$('#report_language').hide()
Maybe you wrote JavaScript code into file with extension .coffee
you can use js2.coffee to convert your code from JavaScript to CoffeeSecript
You can embed regular javascript by surrounding the code with back-ticks "`". I wish it worked like the other parsing languages as well...it took me lot's of unnecessary debugging and searching to figure that out. http://coffeescript.org/#embedded