I’m trying to get emberjs working on rails and have been following this tutorial:
http://www.zhubert.com/blog/2012/04/28/ember-dot-js-and-rails-part-2/
When I try to run this command in the browser console:
var posts = App.store.findAll(App.Post)
I get an error because there is no findAll method on the store. I am using ember-data and am setting up the store like this:
App.store = DS.Store.extend({
revision: 4,
adapter: DS.RESTAdapter.create()
});
I’ve been using the ember rails generators but the whole thing seems pretty flakey, please help!
When using Ember’s new router, it expects you to provide a class called
App.Store. It then instantiates this asApp.router.store. Thestoreproperty is also automatically set on any controllers instantiated by the router.