Recently I read the article “An In-depth Introduction to Emberjs” and followed step by step of its example code, but when it goes to renderTemplate part, it doesn’t work at all. Here is my code(not all the code):
app.js:
App = Ember.Application.create();
App.Router.map(function() {
this.resource('users', function() {
this.resource('user', {path : '/:user_id'}, function() {
this.route('edit');
});
this.route('create');
});
this.resource('tests');
});
App.UsersCreateRoute = Ember.Route.extend({
model : function() {
return Ember.Object.create({});
},
renderTemplate : function() {
this.render('user.edit', {
controller : 'usersCreate'
});
}
});
It’s weird that when I go to /index.html#/users/create
, user/edit
template doesn’t come into sight, but there is no error reported in the console, and when I defined a template whose id is users/create
, this users/create
template got rendered on the page.
So why here the renderTemplate
method doesn’t work?
Thanks.