ember-rails
ember-rails copied to clipboard
doc update: mention conflict with handlebars_assets
having the handlebars_assets gem in along with ember-rails will cause an unending fury of frustration since none of the templates will ever get picked up and you wont know why
a few ideas to make this little conflict less painful to people adding ember-rails to an existing project:
low effort: add a note in the readme recommending to remove handlebars_assets
when using ember-rails
medium effort: add runtime check with error message
high effort: allow both gems to work happily together
I can possibly tackle the low/medium effort items. high effort one is probably not required as long as we're clear that handlebars_assets and ember-rails are Gemfile mortal enemies
@railsjedi - I think the low + medium effort items you have listed would likely do enough to make this much less of an issue (at least on the debugging side). A PR would definitely be welcome...
awesome, will do
In the debugger I noticed that the templates were being loaded up, they were just being added to the wrong object.
This seems to work around the issue:
window.Application = Ember.Application.create
ready: ->
Ember.TEMPLATES = HandlebarsTemplates
Turns out the that approach doesn't work because Handlebars isn't set up to use Ember's helpers. I'm not sure how to get that working, so I ended up scrapping this approach and removing the handlebars_assets
gem.