title: Ember - Cannot read property 'replace' of undefined
body: <h2>My application</h2>
  
  <p>Im trying to build a fairly simple application using Laravel as a RESTfull API server and Ember as my fontend framework</p>
  
  <p>My backend server lives on <code>http://api.example.com/1.0/</code></p>
  
  <p>My frontend lives on <code>http://www.example.com/</code></p>
  
  <p>Ive just started this project so I'm only a few hours into the devlopment, so there might be some configuration issues that Im missing here, but anyway.</p>
  
  <p>Im trying to get a list of products from my server and display them in my ember application using ember-data</p>
  
  <p>Im running ember 2.0.2 and ember-data 2.0.0</p>
  
  <p>Im getting the following error in chrome.</p>
  
  <h2>Error</h2>
  
  <blockquote>
    <p>Error while processing route: product Cannot read property 'replace'
    of undefined TypeError: Cannot read property 'replace' of undefined
        at Object.func (<a href="http://localhost:4200/assets/vendor.js:45832:15" rel="nofollow">http://localhost:4200/assets/vendor.js:45832:15</a>)
        at Object.Cache.get (<a href="http://localhost:4200/assets/vendor.js:23421:36" rel="nofollow">http://localhost:4200/assets/vendor.js:23421:36</a>)
        at decamelize (<a href="http://localhost:4200/assets/vendor.js:45874:29" rel="nofollow">http://localhost:4200/assets/vendor.js:45874:29</a>)
        at Object.func (<a href="http://localhost:4200/assets/vendor.js:45789:12" rel="nofollow">http://localhost:4200/assets/vendor.js:45789:12</a>)
        at Object.Cache.get (<a href="http://localhost:4200/assets/vendor.js:23421:36" rel="nofollow">http://localhost:4200/assets/vendor.js:23421:36</a>)
        at Object.dasherize (<a href="http://localhost:4200/assets/vendor.js:45878:35" rel="nofollow">http://localhost:4200/assets/vendor.js:45878:35</a>)
        at ember$data$lib$system$normalize$model$name$$normalizeModelName (<a href="http://localhost:4200/assets/vendor.js:66295:27" rel="nofollow">http://localhost:4200/assets/vendor.js:66295:27</a>)
        at ember$data$lib$serializers$json$serializer$$default.extend.modelNameFromPayloadKey
    (<a href="http://localhost:4200/assets/vendor.js:75184:67" rel="nofollow">http://localhost:4200/assets/vendor.js:75184:67</a>)
        at ember$data$lib$serializers$json$serializer$$default.extend._normalizeResourceHelper
    (<a href="http://localhost:4200/assets/vendor.js:75064:30" rel="nofollow">http://localhost:4200/assets/vendor.js:75064:30</a>)
        at Array.map (native)</p>
  </blockquote>
  
  <h2>Files</h2>
  
  <p>In ember I have generated a product resource giving my the following files.</p>
  
  <pre class="lang-js prettyprint-override"><code>// app/routes/product.js
  
  import Ember from 'ember';
  export default Ember.Route.extend({
    model() {
      return this.store.findAll('product');
    }
  });
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>// app/model/product.js
  
  import DS from 'ember-data';
  export default DS.Model.extend({
    name: DS.attr(),
    price: DS.attr()
  });
  </code></pre>
  
  <h2>JSON response</h2>
  
  <p>The Json returned from my api <code>http://api.example.com/1.0/products</code>
  </p>
  
  <pre><code>{
    "data": [
      {
        "id": "1",
        "name": "dolores",
        "price": "59015",
        "created_at": "2015-09-06 16:18:13",
        "updated_at": "2015-09-06 16:18:13"
      },
      {
        "id": "2",
        "name": "debitis",
        "price": "57449",
        "created_at": "2015-04-07 14:45:16",
        "updated_at": "2015-04-07 14:45:16"
      },
      ...
    ]
  }
  </code></pre>