Creating a simple ember app and trying to get data using Ember Data. I was using Fixtures before and that worked fine, so I’m pretty sure the problem is related to Ember data.
The callstack is:
Error: Assertion Failed: The response from a findAll must be an Array, not undefined at new Error (native) at Error.Ember.Error (http://sdevelomentdt:8000/vendor/ember/ember.js:844:19) at Object.Ember.assert (http://sdevelomentdt:8000/vendor/ember/ember.js:73:11) at http://sdevelomentdt:8000/vendor/ember-data/ember-data.js:10398:15 at invokeCallback (http://sdevelomentdt:8000/vendor/ember/ember.js:9753:19) at publish (http://sdevelomentdt:8000/vendor/ember/ember.js:9423:9) at Promise.publishFulfillment (http://sdevelomentdt:8000/vendor/ember/ember.js:9843:7) at Object.DeferredActionQueues.flush (http://sdevelomentdt:8000/vendor/ember/ember.js:5893:24) at Object.Backburner.end (http://sdevelomentdt:8000/vendor/ember/ember.js:5984:27) at Object.Backburner.run (http://sdevelomentdt:8000/vendor/ember/ember.js:6023:18) ember.js:3461 Uncaught Error: Assertion Failed: Error: Assertion Failed: The response from a findAll must be an Array, not undefined
I’ve validated the JSON response is valid JSON and conforms to what Ember should be expecteding:
{
"todos": [{
"id": "1",
"title": "Get Rich Real Quick?",
"isCompleted": "true" ,
"showRecord": "true"
}]
}
Other than that, it’s pretty much boiler plate code to get the data. In the router :
App.Todo = DS.Model.extend({
id: DS.attr('integer'),
title: DS.attr('string'),
isCompleted: DS.attr('boolean'),
showRecord: DS.attr('boolean')
});
return this.store.find('Todo');