简体   繁体   中英

Why is Ember/handlebars.js adding 'app/' to the front of my template files?

When Load my Rails ember app I get a blank screen because ember is trying to find my application and index templates at

Ember.TEMPLATES['application] and Ember.TEMPLATES['index']

But when I run Ember.TEMPLATES in the console it brings up all the templates as 'app/application' and 'app/index'.

So ember is looking for /application.hbs but cant find it because for some reason the templates are listed as app/application. But the actual file structure of app is:

assets -> javascripts -> app -> templates -> application.hbs and index.hbs

So their direct parent is not 'app/'

在此处输入图片说明

Any idea why its doing this and how to fix it?

Thank you!

Ember-Rails compiles the handlebars from the assets/javascripts directory directly.
You have two options, modify your hierarchy to not use the app folder.

Or set config.handlebars.templates_root = 'app' in your application.rb .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM