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 trialCynthia Gorsick
9,737 PointsCode Challenge Kittens and Puppies
Create a router for the AnimalShelter app with resources for kittens and puppies.
This is my code, I had originally done this code without doing the router=create part. but no matter what I do, it says it's wrong. It's currently telling me that the function shouldn't be undefined, but I wouldn't have a clue what to define it as. Help?
AnimalShelter = Ember.Application.create();
router = Ember.Application.create();
AnimalShelter.router.map(function(){
this.resource('kittens');
this.resource('puppies');
});
<!DOCTYPE html>
<html>
<head>
<title>Animal Shelter</title>
</head>
<body>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-v1.3.0.js"></script>
<script src="js/libs/ember-1.8.1.js"></script>
<script src="js/app.js"></script>
<script type="text/x-handlebars">
<p>We have so many cute puppies!</p>
</script>
</body>
</html>
2 Answers
akak
29,445 PointsHi,
It's Router - capital 'R' :)
AnimalShelter = Ember.Application.create();
AnimalShelter.Router.map(function(){
this.resource('kittens');
this.resource('puppies');
});
Cynthia Gorsick
9,737 PointsThank you!