Question

I'm new to Ember, and I'm trying to build on a Rails API; however, I don't want to turn on the RESTAdapter at this point. It does not look as if the Fixture adapter is loading data as expected, and I'm not sure why.

I haven't done much but run the bootstrap command that I was instructed to do with the ember-rails gem. When I go to the root path, it tells me there are no clients loaded. Looking at the Ember Plugin in Chrome, everything looks fine, until I click on the data tab, then I get the following error:

Uncaught TypeError: Cannot call method 'canCatalogEntriesByType' of undefined ember.js?body=1:41933 Ember.DataAdapter.Ember.Object.extend.getModelTypes ember.js?body=1:41933 Ember.DataAdapter.Ember.Object.extend.watchModelTypes ember.js?body=1:41726 Ember.Object.extend.messages.getModelTypes VM14057:464 sendEvent ember.js?body=1:2598 Ember.Evented.Ember.Mixin.create.trigger ember.js?body=1:18317 (anonymous function) VM14057:1596 (anonymous function) VM14057:200 Ember.Object.extend._messageReceived VM14057:199 (anonymous function) VM14057:246 Backburner.run ember.js?body=1:6250 Ember.run ember.js?body=1:6665 (anonymous function)

Here is my code thus far:

Store

App.Store = DS.Store.extend({
  // Override the default adapter with the `DS.ActiveModelAdapter` which
  // is built to work nicely with the ActiveModel::Serializers gem.
  adapter: "DS.FixtureAdapter"
});

Router

App.Router.map(function() {
  this.resource('clients', { path: "/" });
});

Route

App.ClientsRoute = Ember.Route.extend({
  model: function(){
    return this.store.all('client');
  }
});

Controller

App.ClientsController = Ember.ArrayController.extend({
});

Model

App.Client = DS.Model.extend({
  name: DS.attr('string'),
  url: DS.attr('string')
});

App.Client.FIXTURES = [
  {
    name: "ACME Homes",
    url: "www.acmehomes.com"
  }
];

Template

<div class="row">
  <div class="col-md-4">
    <h1>Clients</h1>
    {{#each client }}
      {{name}}
    {{else}}
      <p>No clients, silly goose.</p>
    {{/each}}
  </div>
</div>

Any help would be greatly appreciated!

Was it helpful?

Solution

Check this link https://github.com/emberjs/ember-inspector/issues/138 you potentially need to upgrade your version. Upgrading to beta 8 worked for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top