{"action":"created","issue":{"url":"https://api.github.com/repos/abuiles/borrowers/issues/20","repository_url":"https://api.github.com/repos/abuiles/borrowers","labels_url":"https://api.github.com/repos/abuiles/borrowers/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/abuiles/borrowers/issues/20/comments","events_url":"https://api.github.com/repos/abuiles/borrowers/issues/20/events","html_url":"https://github.com/abuiles/borrowers/issues/20","id":124476936,"number":20,"title":"Page 60: linking to /friends/:friend_id/articles from friends index results in Error 'Uncaught Error: More context objects were passed than there are dynamic segments for the route: articles'","user":{"login":"AKHarris","id":5504772,"avatar_url":"https://avatars.githubusercontent.com/u/5504772?v=3","gravatar_id":"","url":"https://api.github.com/users/AKHarris","html_url":"https://github.com/AKHarris","followers_url":"https://api.github.com/users/AKHarris/followers","following_url":"https://api.github.com/users/AKHarris/following{/other_user}","gists_url":"https://api.github.com/users/AKHarris/gists{/gist_id}","starred_url":"https://api.github.com/users/AKHarris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AKHarris/subscriptions","organizations_url":"https://api.github.com/users/AKHarris/orgs","repos_url":"https://api.github.com/users/AKHarris/repos","events_url":"https://api.github.com/users/AKHarris/events{/privacy}","received_events_url":"https://api.github.com/users/AKHarris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-31T14:43:46Z","updated_at":"2016-02-17T15:18:52Z","closed_at":null,"body":"I'm running into an issue at Page 60 in the 'Nested Articles Index' section of the book. At the part where you write\r\n\r\n> If we visit a friend profile, we won’t see anything related with the articles index route. Why? Well,\r\n> we are not visiting that route, that’s why. To get to the articles index route, we need to modify the\r\n> link-to in app/templates/friends/index.hbs to reference the route articles instead of friends.show.\r\n> **We’ll still pass the friend as an argument since the route articles is nested under friends.show \r\n> and it has the dynamic segment :friend_id.**\r\n\r\nso I updated the /app/templates/friends/index.hbs\r\n````html\r\n<table class=\"primary\">\r\n  <thead>\r\n    <tr>\r\n      <th>Name</th>\r\n      <th>Articles</th>\r\n      <th></th>\r\n    </tr>\r\n  </thead>\r\n  <tbody>\r\n    {{#each model as |friend|}}\r\n      <tr>\r\n        <!-- update the link to 'articles' as specified in the passage above -->\r\n        <td>{{link-to friend.fullName \"articles\" friend}}</td>\r\n        <td>{{friend.totalArticles}}</td>\r\n        <td><a href=\"#\"{{action 'delete' friend}}>Delete</a></td>\r\n      </tr>\r\n    {{/each}}\r\n  </tbody>\r\n</table>\r\n````\r\n\r\nwhich results in the `Uncaught Error: More context objects were passed than there are dynamic segments for the route: articles` error from the browser console.\r\n\r\n![screen shot 2015-12-31 at 9 33 38 am](https://cloud.githubusercontent.com/assets/5504772/12065249/ac9e91f4-afa1-11e5-922d-bf72aa3f22aa.png)\r\n\r\nmy /app/router.js looks like this\r\n````javascript\r\nimport Ember from 'ember';\r\nimport config from './config/environment';\r\n\r\nconst Router = Ember.Router.extend({\r\n  location: config.locationType\r\n});\r\n\r\nRouter.map(function() {\r\n  this.route('friends', function() {\r\n    this.route('new');\r\n\r\n    this.route('show', {\r\n      path: ':friend_id'\r\n    }, function() {\r\n      this.route('articles', {resetNamespace: true}, function() {\r\n      });\r\n    });\r\n\r\n    this.route('edit', {\r\n      path: ':friend_id/edit'\r\n    });\r\n\r\n  });\r\n  this.route('articles');\r\n});\r\n\r\nexport default Router;\r\n````\r\n\r\nI'm going to experiment with placing the articles index template in different places depending on what the ember inspector tells me. I'll update the issue if I find a solution."},"comment":{"url":"https://api.github.com/repos/abuiles/borrowers/issues/comments/185249866","html_url":"https://github.com/abuiles/borrowers/issues/20#issuecomment-185249866","issue_url":"https://api.github.com/repos/abuiles/borrowers/issues/20","id":185249866,"user":{"login":"Stas-Buzunko","id":12331100,"avatar_url":"https://avatars.githubusercontent.com/u/12331100?v=3","gravatar_id":"","url":"https://api.github.com/users/Stas-Buzunko","html_url":"https://github.com/Stas-Buzunko","followers_url":"https://api.github.com/users/Stas-Buzunko/followers","following_url":"https://api.github.com/users/Stas-Buzunko/following{/other_user}","gists_url":"https://api.github.com/users/Stas-Buzunko/gists{/gist_id}","starred_url":"https://api.github.com/users/Stas-Buzunko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stas-Buzunko/subscriptions","organizations_url":"https://api.github.com/users/Stas-Buzunko/orgs","repos_url":"https://api.github.com/users/Stas-Buzunko/repos","events_url":"https://api.github.com/users/Stas-Buzunko/events{/privacy}","received_events_url":"https://api.github.com/users/Stas-Buzunko/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T15:18:52Z","updated_at":"2016-02-17T15:18:52Z","body":"Yes, I do. I don't know how to create a jsbin, well I can find it out if you need, but my code is exactly the same as above"}}