title: Setting up Ember-Data DS.RESTadapter with Wordpress and JSON REST API Plugin
body: <p>I'm just getting started with ember, and working on an ember.js app which loads it's data store from a Wordpress blog, which is running the <a href="https://github.com/WP-API/WP-API" rel="nofollow noreferrer">JSON REST API</a> plugin.</p>
  <p>The API has a namespace of 'wp-json.php', and uses these <a href="https://github.com/WP-API/WP-API/blob/master/docs/guides/working-with-posts.md" rel="nofollow noreferrer">conventions</a>.</p>
  <p><strong>Issue I:</strong>
  I'm getting the error <code>Error while loading route</code> once I try to setup the DS.RESTAdapter, and load the model.</p>
  <p><strong>Issue II:</strong>
  I'm trying to pass the header <code>&quot;type&quot;: &quot;custom_post_type_slug&quot;</code>, in order to get the data of a <a href="https://github.com/WP-API/WP-API/blob/master/docs/guides/working-with-posts.md#collection-views" rel="nofollow noreferrer">custom post type</a>, and can't get that to work either.</p>
  <p>Here is my code:</p>
  <pre><code>    App = Ember.Application.create({ }); //Create App
  
      //Router
      App.Router.map(function () { 
  
    
    
             this.resource('posts', {path: '/'},  function() {
    
      
                  this.resource('post', { path: ':post_id' } );
    
                   });
     
     
    
         }); //End Router
  
  
  
  
      //Posts Route 
      App.PostsRoute = Ember.Route.extend({
  
         model: function(){
             return this.store.find('post');
      
      
         },
  
      
       });
  
  
  
  
     //Data
  
     App.Post = DS.Model.extend({
        title         : DS.attr('string'),
    
  });
  
  
  
  
     App.PostAdapter = DS.RESTAdapter.extend({
        host: 'http://example.com',
        namespace: 'wp-json.php'
     });
  
  
      DS.RESTAdapter.reopen({
        headers: {
         &quot;type&quot;: &quot;custom_post_type_slug&quot;
   
         }
       }); 
  </code></pre>
  <p>Any pointers would be greatly appreciated!</p>