meleyal / backbone-on-rails

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

Generator not working with Engines #43

Closed cantonic closed 11 years ago

cantonic commented 11 years ago

I have a mountable Engine (Rails 3.2.12) where I tried to install backbone-on-rails, but after running rails g backbone:install it generates a file called nil_class.js.coffee. This is because it cannot find the Engine's name.

clekstro commented 11 years ago

I'm experiencing the same behavior with a newly created (mountable) Rails 4 engine. The output of the generator is the following:

├── bb_engine/ │   └── application.js ├── collections/ ├── models/ ├── routers/ ├── views/ ├── application.js └── nil_class.js.coffee

To reproduce, simply create a new Rails 4 mountable engine:

rails plugin new bb_engine --mountable

Then add backbone-on-rails gem to the .gemspec and bundle. Afterwards, run the included generator:

rails g backbone:install
samarthsikotara commented 9 years ago

@clekstro Can I change a name to bb_engine.js.coffee instead of nil_class.js.coffee?

clekstro commented 9 years ago

@samarthsikotara I haven't looked into this since I originally replied, and don't currently use this gem. Does renaming the file help resolve this issue?

samarthsikotara commented 9 years ago

@clekstro Yes It resolves this issue. can I know which gem do you use for bootstrap rails?

samarthsikotara commented 9 years ago

@clekstro sorry I typed "bootstrap" by mistake. it's backbone rails. which gem do you use for backbone rails?