getoutreach / epf

A framework for keeping your Ember.js apps in sync.
http://epf.io
MIT License
369 stars 33 forks source link

Does not load model #45

Closed zooshme closed 11 years ago

zooshme commented 11 years ago

This is my code:

App = Ember.Application.create(); App.ApplicationView = Ember.View.extend();

App.Router = Ember.Router.extend();

App.Router.map(function() { });

var serializer = Ep.RestSerializer.extend();

App.Adapter = Ep.RestAdapter.extend({ namespace: 'api', serializer: serializer });

App.Post = Ep.Model.extend({ title: Ep.attr('string') });

App.IndexRoute = Ember.Route.extend({ model: function() { this.session.load('post') }, renderTemplate: function() { //console.log(this.session.load(App.Post)) this.render('index'); } });

I get these two errors in the Chrome console: Error while loading route: TypeError {} Uncaught TypeError: Cannot call method 'toString' of undefined

ghempton commented 11 years ago

session.load requires an id (e.g. session.load('post', 1)). If you are trying to load all posts do a session.query('post').

zooshme commented 11 years ago

Thanks a lot.