{"action":"created","issue":{"url":"https://api.github.com/repos/ga-dc/pbj-project3/issues/68","labels_url":"https://api.github.com/repos/ga-dc/pbj-project3/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/ga-dc/pbj-project3/issues/68/comments","events_url":"https://api.github.com/repos/ga-dc/pbj-project3/issues/68/events","html_url":"https://github.com/ga-dc/pbj-project3/issues/68","id":103721670,"number":68,"title":"Getting model \"not found error\"","user":{"login":"Walter-0","id":10503240,"avatar_url":"https://avatars.githubusercontent.com/u/10503240?v=3","gravatar_id":"","url":"https://api.github.com/users/Walter-0","html_url":"https://github.com/Walter-0","followers_url":"https://api.github.com/users/Walter-0/followers","following_url":"https://api.github.com/users/Walter-0/following{/other_user}","gists_url":"https://api.github.com/users/Walter-0/gists{/gist_id}","starred_url":"https://api.github.com/users/Walter-0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Walter-0/subscriptions","organizations_url":"https://api.github.com/users/Walter-0/orgs","repos_url":"https://api.github.com/users/Walter-0/repos","events_url":"https://api.github.com/users/Walter-0/events{/privacy}","received_events_url":"https://api.github.com/users/Walter-0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-08-28T13:46:40Z","updated_at":"2015-08-28T14:57:04Z","closed_at":null,"body":"We have questions showing up as expected, but when we try to post answers to the question, we see this error we specified.\r\n\r\nThis is the post route for the answer controller. We are getting the error to be returned below if the question is not there.\r\n```\r\nrouter.post(\"/answers\", function(req, res){\r\n  Question.findById(req.params.questionId)\r\n  .then(function(question){\r\n    if(!question) return error(res, \"not found\");\r\n    return question.createAnswer(req.body);\r\n  })\r\n  .then(function(answers){\r\n    res.json(answers);\r\n  });\r\n});\r\n```\r\n\r\nI tried attaching a hidden input to the answer form, but I'm not sure how to make it get the id of the question selected.\r\n\r\n```\r\n<form method=\"post\" action=\"/answers\" class=\"new-answer\" id=\"new-answer\">\r\n  <textarea name=\"content\" form=\"new-answer\" placeholder=\"Add your answer\" id=\"new-answer-content\" rows=\"8\" cols=\"90\"></textarea>\r\n  <input type=\"submit\" value=\"Submit\" id=\"submit\">\r\n  <input type=\"hidden\" name=\"question\" value=\"\\{{id}}\">\r\n</form>\r\n```\r\n\r\nAlso relevant event listener for the question clicked (not best practice, pretty hacky)\r\n\r\n``` \r\n //event listener for each entry\r\n  $(document).on('click','.entry',function(event){\r\n    $(event.target).siblings().toggle();\r\n    $(\".entry-title\").toggleClass(\"question-title\")\r\n    $(\".question-content\").toggle();\r\n    $(\"#new-answer\").toggle();\r\n  });\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-dc/pbj-project3/issues/comments/135797291","html_url":"https://github.com/ga-dc/pbj-project3/issues/68#issuecomment-135797291","issue_url":"https://api.github.com/repos/ga-dc/pbj-project3/issues/68","id":135797291,"user":{"login":"Walter-0","id":10503240,"avatar_url":"https://avatars.githubusercontent.com/u/10503240?v=3","gravatar_id":"","url":"https://api.github.com/users/Walter-0","html_url":"https://github.com/Walter-0","followers_url":"https://api.github.com/users/Walter-0/followers","following_url":"https://api.github.com/users/Walter-0/following{/other_user}","gists_url":"https://api.github.com/users/Walter-0/gists{/gist_id}","starred_url":"https://api.github.com/users/Walter-0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Walter-0/subscriptions","organizations_url":"https://api.github.com/users/Walter-0/orgs","repos_url":"https://api.github.com/users/Walter-0/repos","events_url":"https://api.github.com/users/Walter-0/events{/privacy}","received_events_url":"https://api.github.com/users/Walter-0/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T14:57:04Z","updated_at":"2015-08-28T14:57:04Z","body":"Do I need the handlebars to pass in an id?"}}