title: Get one Wordpress JetPack call instead of two in Ember js without Ember Data
body: <p>I am an ember beginner and created a test  without Ember Data for the WordPress JetPack json API:  <a href="http://broerse.net/ember/wp3/#/posts" rel="nofollow">http://broerse.net/ember/wp3/#/posts</a> (resulting in one JetPack call)</p>
  
  <p>If you access a post via an URL like <a href="http://broerse.net/ember/wp3/#/posts/3787" rel="nofollow">http://broerse.net/ember/wp3/#/posts/3787</a>  I don’t know how to return a post with an ‘id’ from the objects created with findAll. I ended up fetching the specific post by ‘id’ from JetPack again. Is there a way to rewrite ‘find’ in the code below so there is no need for two JetPack call’s?</p>
  
  <pre><code>App = Ember.Application.create();
  
  App.Router.map(function() {
    this.resource('posts', function() {
      this.resource('post', { path: ':post_id' });
    });
  });
  
  App.Post = Ember.Object.extend();
  
  App.Post.reopenClass({
    findAll: function() {
      return Ember.$.ajax({ url: 'http://public-api.wordpress.com/rest/v1/sites/58826716/posts/?number=10', dataType: "jsonp", type: 'GET' }).then(function(data) {
        return data.posts.map(function(post) {
          post['id'] = post['ID'];
          delete post['ID']; 
          return App.Post.create(post);
        });
      });
    },
  
    find: function(id) {
      return Ember.$.ajax({ url: 'http://public-api.wordpress.com/rest/v1/sites/58826716/posts/' + id + '/', dataType: "jsonp", type: 'GET' }).then(function(post) {
        post['id'] = post['ID'];
        delete post['ID']; 
        return App.Post.create(post);
      });
    }
  
  });
  
  App.PostsRoute = Ember.Route.extend({
    model: function() {
      return App.Post.findAll();
    }
  });
  
  App.PostRoute = Ember.Route.extend({
    model: function(params) {
      return App.Post.find(params.post_id);
    }
  });
  </code></pre>