{"action":"created","comment":{"url":"https://api.github.com/repos/Backstabe/qna/pulls/comments/27777520","id":27777520,"diff_hunk":"@@ -9,15 +9,25 @@ def create\n     @answer.save\n   end\n \n+  def update\n+    @answer = Answer.find(params[:id])\n+    @answer.update(answer_params)\n+    @question = @answer.question\n+  end\n+\n   def destroy\n     if  @answer.user_id == current_user.id\n       @answer.destroy\n-      redirect_to question_path(@answer.question), notice: 'Your answer is removed'\n-    else\n-      redirect_to question_path(@answer.question), notice: 'You are not the author of the answer'\n+      @question = @answer.question\n     end\n   end\n \n+  def make_best\n+    @answer = Answer.find params[:id]","path":"app/controllers/answers_controller.rb","position":29,"original_position":29,"commit_id":"4ba4e69556918b4ab09b88734c103f51ed26021b","original_commit_id":"4ba4e69556918b4ab09b88734c103f51ed26021b","user":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"body":"`@answer` же загружается в `load_answer`.  Ну и вопрос тоже лучше загружить в фильтре `load_question`, чтобы не дублировать.","created_at":"2015-04-05T14:07:58Z","updated_at":"2015-04-05T14:07:58Z","html_url":"https://github.com/Backstabe/qna/pull/21#discussion_r27777520","pull_request_url":"https://api.github.com/repos/Backstabe/qna/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/comments/27777520"},"html":{"href":"https://github.com/Backstabe/qna/pull/21#discussion_r27777520"},"pull_request":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/Backstabe/qna/pulls/21","id":32648882,"html_url":"https://github.com/Backstabe/qna/pull/21","diff_url":"https://github.com/Backstabe/qna/pull/21.diff","patch_url":"https://github.com/Backstabe/qna/pull/21.patch","issue_url":"https://api.github.com/repos/Backstabe/qna/issues/21","number":21,"state":"open","locked":false,"title":"Lesson7","user":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-05T13:49:36Z","updated_at":"2015-04-05T14:07:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"879dae555448d898b8e0f8be4d46caaee25008cc","assignee":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Backstabe/qna/pulls/21/commits","review_comments_url":"https://api.github.com/repos/Backstabe/qna/pulls/21/comments","review_comment_url":"https://api.github.com/repos/Backstabe/qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Backstabe/qna/issues/21/comments","statuses_url":"https://api.github.com/repos/Backstabe/qna/statuses/4ba4e69556918b4ab09b88734c103f51ed26021b","head":{"label":"Backstabe:lesson7","ref":"lesson7","sha":"4ba4e69556918b4ab09b88734c103f51ed26021b","user":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"repo":{"id":31914892,"name":"qna","full_name":"Backstabe/qna","owner":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Backstabe/qna","description":"учебный репозиторий","fork":false,"url":"https://api.github.com/repos/Backstabe/qna","forks_url":"https://api.github.com/repos/Backstabe/qna/forks","keys_url":"https://api.github.com/repos/Backstabe/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Backstabe/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Backstabe/qna/teams","hooks_url":"https://api.github.com/repos/Backstabe/qna/hooks","issue_events_url":"https://api.github.com/repos/Backstabe/qna/issues/events{/number}","events_url":"https://api.github.com/repos/Backstabe/qna/events","assignees_url":"https://api.github.com/repos/Backstabe/qna/assignees{/user}","branches_url":"https://api.github.com/repos/Backstabe/qna/branches{/branch}","tags_url":"https://api.github.com/repos/Backstabe/qna/tags","blobs_url":"https://api.github.com/repos/Backstabe/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Backstabe/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Backstabe/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/Backstabe/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Backstabe/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/Backstabe/qna/languages","stargazers_url":"https://api.github.com/repos/Backstabe/qna/stargazers","contributors_url":"https://api.github.com/repos/Backstabe/qna/contributors","subscribers_url":"https://api.github.com/repos/Backstabe/qna/subscribers","subscription_url":"https://api.github.com/repos/Backstabe/qna/subscription","commits_url":"https://api.github.com/repos/Backstabe/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/Backstabe/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/Backstabe/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/Backstabe/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/Backstabe/qna/contents/{+path}","compare_url":"https://api.github.com/repos/Backstabe/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Backstabe/qna/merges","archive_url":"https://api.github.com/repos/Backstabe/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Backstabe/qna/downloads","issues_url":"https://api.github.com/repos/Backstabe/qna/issues{/number}","pulls_url":"https://api.github.com/repos/Backstabe/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/Backstabe/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/Backstabe/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Backstabe/qna/labels{/name}","releases_url":"https://api.github.com/repos/Backstabe/qna/releases{/id}","created_at":"2015-03-09T18:20:11Z","updated_at":"2015-03-31T20:46:38Z","pushed_at":"2015-04-05T13:49:37Z","git_url":"git://github.com/Backstabe/qna.git","ssh_url":"git@github.com:Backstabe/qna.git","clone_url":"https://github.com/Backstabe/qna.git","svn_url":"https://github.com/Backstabe/qna","homepage":null,"size":376,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Backstabe:master","ref":"master","sha":"a5f1e7946e1200156afacbdc4140442da9c32810","user":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"repo":{"id":31914892,"name":"qna","full_name":"Backstabe/qna","owner":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Backstabe/qna","description":"учебный репозиторий","fork":false,"url":"https://api.github.com/repos/Backstabe/qna","forks_url":"https://api.github.com/repos/Backstabe/qna/forks","keys_url":"https://api.github.com/repos/Backstabe/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Backstabe/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Backstabe/qna/teams","hooks_url":"https://api.github.com/repos/Backstabe/qna/hooks","issue_events_url":"https://api.github.com/repos/Backstabe/qna/issues/events{/number}","events_url":"https://api.github.com/repos/Backstabe/qna/events","assignees_url":"https://api.github.com/repos/Backstabe/qna/assignees{/user}","branches_url":"https://api.github.com/repos/Backstabe/qna/branches{/branch}","tags_url":"https://api.github.com/repos/Backstabe/qna/tags","blobs_url":"https://api.github.com/repos/Backstabe/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Backstabe/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Backstabe/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/Backstabe/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Backstabe/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/Backstabe/qna/languages","stargazers_url":"https://api.github.com/repos/Backstabe/qna/stargazers","contributors_url":"https://api.github.com/repos/Backstabe/qna/contributors","subscribers_url":"https://api.github.com/repos/Backstabe/qna/subscribers","subscription_url":"https://api.github.com/repos/Backstabe/qna/subscription","commits_url":"https://api.github.com/repos/Backstabe/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/Backstabe/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/Backstabe/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/Backstabe/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/Backstabe/qna/contents/{+path}","compare_url":"https://api.github.com/repos/Backstabe/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Backstabe/qna/merges","archive_url":"https://api.github.com/repos/Backstabe/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Backstabe/qna/downloads","issues_url":"https://api.github.com/repos/Backstabe/qna/issues{/number}","pulls_url":"https://api.github.com/repos/Backstabe/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/Backstabe/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/Backstabe/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Backstabe/qna/labels{/name}","releases_url":"https://api.github.com/repos/Backstabe/qna/releases{/id}","created_at":"2015-03-09T18:20:11Z","updated_at":"2015-03-31T20:46:38Z","pushed_at":"2015-04-05T13:49:37Z","git_url":"git://github.com/Backstabe/qna.git","ssh_url":"git@github.com:Backstabe/qna.git","clone_url":"https://github.com/Backstabe/qna.git","svn_url":"https://github.com/Backstabe/qna","homepage":null,"size":376,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/21"},"html":{"href":"https://github.com/Backstabe/qna/pull/21"},"issue":{"href":"https://api.github.com/repos/Backstabe/qna/issues/21"},"comments":{"href":"https://api.github.com/repos/Backstabe/qna/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/Backstabe/qna/statuses/4ba4e69556918b4ab09b88734c103f51ed26021b"}}}}