Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900