Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Ember Data with local storage challenge

Link to Challenge: http://teamtreehouse.com/library/emberjs/ember-data/challenge-local-storage

Challenge Task 1 of 1

Update PuppiesRoute to return all of the puppy objects from the Ember Data store.

Again..because this course is too new, there is no forum thread for this challenge so I decided to make one.

The challenge question says 'puppy objects' *with an 's" which to me means plural).

So I tried:

AnimalShelter.PuppiesRoute = Ember.Route.extend({
  model: function() {
    // your code goes here
    return this.store.find('puppy');
  }
});

..which of course was wrong, but the Bummer message was at least helpful (a rare occurrence in my experience):

Bummer! You need to pass the string 'puppy' to the 'find' function.

So I changed the code to:

AnimalShelter = Ember.Application.create();

AnimalShelter.Router.map(function() {
  this.resource('puppies', {path: '/'});
  this.resource('puppy', {path: 'puppies/:puppy_id'});
});

AnimalShelter.PuppiesRoute = Ember.Route.extend({
  model: function() {
    // your code goes here
    return this.storeAnimalShelter = Ember.Application.create();

AnimalShelter.Router.map(function() {
  this.resource('puppies', {path: '/'});
  this.resource('puppy', {path: 'puppies/:puppy_id'});
});

AnimalShelter.PuppiesRoute = Ember.Route.extend({
  model: function() {
    // your code goes here
    return this.store.find('puppy');
  }
});
  }
});

...and that's just what it wanted to pass! :thumbsup: