I would recommend not to do this. See My answer in the Template for CoffeeScript Modules for some reason. ("Making CoffeeScript code incompatible with ready-made Rails 3.1" is another reason.) It's better to just use
window.a = b
or even
@a = b
instead of a = b when you are trying to export something to a global scope.
In previous versions of Rails 3.1, bare compilation was enabled. This was classified as a bug and fixed in RC1.
So, although I strongly recommend you not to do this , here's how to enable bare assembly: Add
Tilt::CoffeeScriptTemplate.default_bare = true
to your environment.rb .
Trevor Burnham May 23 '11 at 16:08 2011-05-23 16:08
source share