My Rails 3.1.rc4 application is working fine, but I'm trying to find a suitable way to store js files in the pipeline. If I put some code in a file other than application.js, I get the following error:
GET "/assets/application.js" will start for 127.0.0.1 on 2011-07-21 23:15:02 -0500 Compiled ~ / Dropbox / Rails / MyApp / application / assets / JavaScripts / application.js.coffee (224ms) (pid 69397) Error compiling an asset application.js: ExecJS :: ProgramError: SyntaxError: reserved word "function" on line 1 (in /Users/micahalcorn/Dropbox/Rails/myapp/app/assets/javascripts/users/registrations.js .coffee) Service asset /application.js - 500 Internal server error
This happens regardless of which file ( registrations in this case) and requires a "reserved word" regardless of the first word in the file ( var , function , etc.). I use node.js as a runtime and everything works fine if I remove coffeescript by compiling gems and treating it as a Rails 3.0 application. I want to better understand the asset pipeline and follow conventions. Thanks for any suggestions!
source share