Why can't I pass the Id as a parameter in this scenario:
App.Router.map(function () {
this.route("home", {path: '/'});
});
App.HomeRoute = Ember.Route.extend({
model: function () {
// return this.store.find('post');//works
return this.store.find('post',1);//does not
},
setupController: function (controller, model) {
controller.set('info', model);
}
});
Fiddle: http://ift.tt/1AfbmDo
I know I am trying to do this from my 'home' route so I would guess that if a created a posts/[:id] route it would all work a lot better.
How can I return only one post in my home route?
Aucun commentaire:
Enregistrer un commentaire