Adding Data to Store and finding it with Basic Adapter


#1

I am starting with a simple ember-data project and looking to just have a control which shows some filtered data.

I receive the error: Your server returned a hash with the key name but you have no mapping for it

My adapter is simply:

var adapter = DS.Adapter.create({
    findQuery: function(store, type, query, recordArray) {
        this.didFindQuery(store, type, query, recordArray );
    }
})

I’d like to have an action something like addFoo here:

App.IndexController = Ember.ArrayController.extend({
            addFoo: function() {
                this.get('store').load(App.Data, {
                    id: 2,
                    name: 'foo'
                }, { id: 2 });
            },
            addManyFoo: Ember.K
        });

where App.Data is just:

App.Data = DS.Model.extend({
            name: DS.attr('string')
        });

Can someone help out with that?


#2

This might be a better fit on stackoverflow


#3

Thanks Toran, I managed to get some find()ing working with the DS.FixtureAdapter, but still curious how to do it with the DS.Adapter, although it may just be a base class not meant to be used directly. Also the topic a bit misleading since I am not using DS.BasicAdapter.

SO http://stackoverflow.com/questions/15802998/ember-store-with-fixtures