meleyal / backbone-on-rails

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

Install generator assumes //= require_tree in application.js #16

Closed mraaroncruz closed 11 years ago

mraaroncruz commented 12 years ago

If you don't have the line //= require_tree in your app/assets/javascripts/application.js[.coffee] file and run the generator, backbone-on-rails doesn't add the dependencies and quietly swallows the error(?). If I hadn't watched the Railscast, I wouldn't have even noticed this. Kills core functionality. If I use the lib in more than one project, I will submit a patch. Maybe is what caused Issue #2? Speculation of course ;)

mraaroncruz commented 12 years ago

Just to close the loop :) #3

meleyal commented 12 years ago

Will look into this for the next release.

meleyal commented 12 years ago

Any chance of a patch for this?

mraaroncruz commented 12 years ago

I'll give a strong maybe. I don't have a great record of following through on these things.

mulderp commented 12 years ago

from what I learned yesterday, the 'require_tree . ' needs to be manually adjusted after running the task:

rake backbone:install

The line with require_tree . needs to be put at the end. I started investigating whether this can be done by parsing the manifest file before injecting the backbone dependencies. My status can be tracked here in the upcoming days/week: https://github.com/mulderp/backbone-on-rails/commits/master

meleyal commented 12 years ago

Thanks for looking into this. It's a good idea to create a branch for your patches, that way it's easier to keep your master branch in sync with the 'official' one.

mulderp commented 12 years ago

should be solved by this: https://github.com/meleyal/backbone-on-rails/pull/29