I'm new to Ember so sorry if it's my wrong doing.
I have an app that was working fine but now I want to connect one of the tables to another in a One to Many relation (one Animal to many ClinicalEpisodes)
Animal model:
App.Animal = DS.Model.extend({
name: DS.attr('string'),
clinicalEpisodes: DS.hasMany('App.ClinicalEpisode',{async:true})
});
Clinical Episodes model:
App.ClinicalEpisode = DS.Model.extend({
animal: DS.belongsTo('App.Animal'),
clinicalEpisodeType: DS.belongsTo('App.ClinicalEpisode'),
observations: DS.attr('string'),
});
And when I try to transition to my create template for animals which as always been working I get "unknown problem" in the console and the transition is aborted.
I've tried:
clinicalEpisodes: DS.hasMany('App.ClinicalEpisode',{async:true})
and
clinicalEpisodes: DS.hasMany('clinicalEpisode',{async:true})
Both give the same error.
Any idea why this is happenning? Do I have to change the routes or controllers for this relation to work?
Aucun commentaire:
Enregistrer un commentaire