meleyal / backbone-on-rails

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

Handlebars Template Name Causes Error #74

Closed adamwgriffin closed 8 years ago

adamwgriffin commented 8 years ago

Using Handlebars, if I run rails generate backbone:scaffold planet --template=hbs it will create the template app/assets/templates/planets/index.hbs and add template: JST['planets/index'] to the generated view. However, when it tries to load that template I get the error "Uncaught ReferenceError: JST is not defined" unless I change the template name to index.jst.hbs. Should the generator add .jst to the file extension so that it works correctly or is there something else wrong?

adamwgriffin commented 8 years ago

Looks like you would just need to add --template_namespace=HandlebarsTemplates as an option to the generator if using the handlebars_assets gem to fix this. It's not a problem with backbone-on-rails.