Reputation: 169
i am building a an app in ember which uses rails as the backend.
I get an error whenever i try navigating to the consultants show route, ember throws the "call stack size exceeded range error". I have successfully built out the other parts of the app using the same kind of methods below, but for some reason navigating to the show route will throw this kind of error.
I'm not sure where the problem is or what's going on. Thanks.
This is the error logged in the chrome console.
Error while loading route: consultant.show Maximum call stack size exceeded RangeError: Maximum call stack size exceeded
at apply (http://localhost:3000/assets/ember.js?body=1:7980:27)
at superWrapper [as renderTemplate] (http://localhost:3000/assets/ember.js?body=1:7567:15)
at Embermaven.ConsultantShowRoute.Ember.Route.extend.renderTemplate (http://localhost:3000/assets/emberadmin/routes/consultants_route.js?body=1:24:10)
at apply (http://localhost:3000/assets/ember.js?body=1:7980:27)
at superWrapper [as renderTemplate] (http://localhost:3000/assets/ember.js?body=1:7567:15)
at Embermaven.ConsultantShowRoute.Ember.Route.extend.renderTemplate (http://localhost:3000/assets/emberadmin/routes/consultants_route.js?body=1:24:10)
at apply (http://localhost:3000/assets/ember.js?body=1:7980:27)
at superWrapper [as renderTemplate] (http://localhost:3000/assets/ember.js?body=1:7567:15)
at Embermaven.ConsultantShowRoute.Ember.Route.extend.renderTemplate (http://localhost:3000/assets/emberadmin/routes/consultants_route.js?body=1:24:10)
at apply (http://localhost:3000/assets/ember.js?body=1:7980:27)
Here is what my route looks like.
Embermaven.ConsultantShowRoute = Ember.Route.extend({
model: function(params){
return this.store.find('consultant, params.consultant_id');
},
renderTemplate: function() {
this.renderTemplate('emberadmin/consultant/show');
},
serialize: function(model){
return { consultant_id: model.get('id') };
}
});
And my router.js file.
this.resource('consultants', function(){});
this.route('consultants.new', {path: '/consultants/new'});
this.route('consultant.show', {path: '/consultant/:consultant_id'});
this.route('consultant.edit', {path: '/consultant/:consultant_id/edit'});
Upvotes: 0
Views: 494
Reputation: 169
Nevermind I figured it out.
I was using renderTemplate rather than this.render.
The conflict was happening when ember didn't know what application template to render.
Upvotes: 1