5

I created a small inventory app in Ember, and followed a tutorial on adding Rails 4 as a persistence layer: http://pixelhandler.com/blog/2013/09/24/scaffold-for-a-browser-app-built-with-ember-js-and-rails/

But now I am getting the following error in the console:

Assertion failed: You included Ember Data but didn't define App.Store

The pages load fine, and it renders my index.erb and application.html.erb, but I get nothing from my ember bits rendered.

I am at a bit of a loss on how to troubleshoot this issue. Can someone point me in the right direction?

Thanks!

Update: I am also getting this error:

Uncaught TypeError: Attempting to register an unknown factory: `store:main`  

and I do have App.Store defined in store.js:

App.Store = DS.Store.extend({
   adapter: DS.RESTAdapter.create()
});
4

1 回答 1

9

我认为您使用的是 Ember Data 0.13 或 0.14。在这些版本中,您需要声明 store 属性。像这样:

App.Store = DS.Store.extend({
  adapter: DS.RESTAdapter
})

更新:我也收到此错误:

Uncaught TypeError: Attempting to register an unknown factory: store:main

确保您的App.Store = ...声明位于 ember-data 脚本之前。

于 2013-11-12T20:01:59.217 回答