When I am trying to load data from rails db with emberjs + ember data I am getting this error
Uncaught TypeError: Cannot call method 'map' of undefined
Here's the coffescript code:
window.Cosmetics = Ember.Application.create
Cosmetics.store = DS.Store.create
revision: 4
adapter: DS.RESTAdapter.create
bulkCommit: false
Cosmetics.admin_user = DS.Model.extend({
name: DS.attr('string')
email: DS.attr('string')
});
Cosmetics.view = Ember.View.extend
templateName: 'ember/views/aaa'
Cosmetics.admin_user.reopenClass
url: 'admin/user'
Cosmetics.store.findAll(Cosmetics.admin_user)
Controller gets proper JSON data. I've tried mapping the code from the examples found over the internet but nothing helped. Any ideas? I guess I'm doing sth wrong. Thanks in advance for any help.