Can't find template when calling route.render('custom') in Ember CLI


#1

I’m migrating my app to Ember CLI and got an index route that renders additional template into an outlet:

export default Ember.Route.extend({
    renderTemplate: function () {
        this.render();

        this.render('about_you', {
            into: 'application',
            outlet: 'about_you'
        });
   }
})

In app/templates directory I’ve got application.hbs, index.hbs and about_you.hbs files, but when accessing index route I’m getting the following error:

Error while processing route: index Assertion Failed: Could not find "about_you" template or view.

It worked fine before when I was using grunt-ember-templates package to compile templates, which put everything into Ember.TEMPLATES.

Also, how can I check if a template with given name exists? Previously I could simply do

if (Ember.TEMPLATES[name]) { do something }

but I’m not sure how can I do it in Ember CLI.


#2

Found it. Ember CLI uses hyphens instead of underscores. Changing template name to about-you.hbs fixed the issue.