Better resolver support for underscored templates. Eventually we'll

migrate to dashed only.
This commit is contained in:
Robin Ward 2014-09-12 14:44:35 -04:00
parent 1de9c3b04a
commit 22fd7fb07d
2 changed files with 8 additions and 2 deletions

View file

@ -112,7 +112,13 @@ export default Ember.DefaultResolver.extend({
}, },
findTemplate: function(parsedName) { findTemplate: function(parsedName) {
return this._super(parsedName) || this.findSlashedTemplate(parsedName) || this.findAdminTemplate(parsedName); return this._super(parsedName) || this.findSlashedTemplate(parsedName) || this.findAdminTemplate(parsedName) || this.findUnderscoredTemplate(parsedName);
},
findUnderscoredTemplate: function(parsedName) {
var decamelized = parsedName.fullNameWithoutType.decamelize();
var underscored = decamelized.replace("-", "_");
return Ember.TEMPLATES[underscored];
}, },
// Try to find a template with slash instead of first underscore, e.g. foo_bar_baz => foo/bar_baz // Try to find a template with slash instead of first underscore, e.g. foo_bar_baz => foo/bar_baz

View file

@ -88,7 +88,7 @@
{{render "siteMap"}} {{render "siteMap"}}
{{/if}} {{/if}}
{{render "userDropdown"}} {{render "user-dropdown"}}
</div> </div>