codebrew / backbone-rails

Easily use backbone.js with rails 3.1
MIT License
1.62k stars 255 forks source link

support pure javascript #150

Open sinisterchipmunk opened 11 years ago

sinisterchipmunk commented 11 years ago

This pull requests adds support for generating pure JavaScript code instead of CoffeeScript code. It also removes the hard dependency on CoffeeScript, allowing Rails apps to make use of this gem without requiring CoffeeScript as a dependency. (For my own case, this also allows me to use a version of CoffeeScript that this project's gemspec would otherwise prohibit.)

The generators can produce pure JavaScript by explicitly passing --javascript, or implicitly by simply omitting CoffeeScript from the Gemfile.

This pull request addresses #46. It also adds a pure JavaScript component to the demo.

It is thoroughly tested.

craig-jennings commented 11 years ago

:+1:

kshahkshah commented 9 years ago

@sinisterchipmunk work was no longer merging due to a minor conflict, I've merged his work with the latest master it's available here

https://github.com/whistlerbrk/backbone-rails/

kshahkshah commented 9 years ago

Except my merge isn't working, and I'm uncertain why -- I have just started using Backbone

The problem appears to be within the index_view at this call:

this.options.MODEL_NAME.bind('reset', this.addAll);

However, it's not the real problem. Inspect this object vs master (vanilla) the object is not subclassing properly. I think some CoffeeScript magic isn't getting triggered

davidahopp commented 9 years ago

Bump!! Any hope of getting this added to the project?