I have a file in my rails 3.1 project called: foo.js.coffee.erb
console.log <?= 1+1 ?>
This causes:
throw Error("ExecJS::ProgramError: Error: Parse error on line 1: Unexpected 'COMPOUND_ASSIGN'\n (in /Users/trafnar/Sites/imagesnap/app/assets/javascripts/tiles.js.coffee.erb)")
Clearly the ERB is tripping it up. I thought Rails 3.1 allowed the use of an ERB preprocessor before coffeescript, why might this be failing?
Are you sure you have your delimiters right? I’d expect to see:
in an
.erbfile.