当我尝试使用emberjs ember数据从rails db加载数据时,我收到此错误
Uncaught TypeError: Cannot call method ‘map’ of undefined
这是coffescript代码:
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获取正确的JSON数据.我已经尝试从互联网上找到的示例中映射代码,但没有任何帮助.有任何想法吗?我想我做错了.在此先感谢您的帮助.