meleyal / backbone-on-rails

A simple gem for using Backbone.js with Rails.
MIT License
810 stars 126 forks source link

malformed application.js manifest entries #26

Closed explainer closed 12 years ago

explainer commented 12 years ago

I was following the RailsCast tutorial #323, which is part one of the backbone-on-rails set. While following along in the tutorial, I ran the following command:

rails g backbone:install

The command generated the standard folders for models, routes, collections, and views, but it also generated manifest entries into my application.js file which are as follows:

//= require jquery //= require jquery_ujs //= require_tree . //
// begin backbone generated entries // //= require underscore //= require backbone // //= require .//raffler // //= require_tree ../templates/ //= require_tree .//models //= require_tree .//collections //= require_tree .//views //= require_tree .//routers // // end backbone generated entries

As you can see, the folder syntax for the models, etc. are malformed, and will cause js uncaught exception errors if not repaired manually.

explainer commented 12 years ago

The blank line in the above example is my typo, it was not in the original.

meleyal commented 12 years ago

Will look into this for the next release.

silvenon commented 12 years ago

How is it supposed to be? I tried

//= require_tree ./models
//= require_tree ./collections
etc.

But it didn't work.

silvenon commented 12 years ago

Nvm, I'm retarded, I didn't realize the //= require_tree . before requiring underscore and backbone required those files too...

johnpena commented 12 years ago

So, just to be clear, the fix (for those still experiencing this) is to remove the //= require_tree . line from application.js