I am using Rails 3.2.13.
After looking at some posts here, it looks like in order to use erb in CoffeeScript, your file just needs to have a .js.coffee
extension, not .js.coffee.erb
(weirdly).
However, I still cannot seem to get it to work. For example, I have the following in a demo.js.coffee
file:
console.log '<%= root_url %>'
Which, after all processing, seems to produce:
(function() {
console.log('<%= root_url %>');
$(function() {});
}).call(this);
As you can see, the CoffeeScript is processed, but the erb isn't. What's going on?