{"action":"created","comment":{"url":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/comments/106813848","pull_request_review_id":27754596,"id":106813848,"diff_hunk":"@@ -1,46 +1,40 @@\n class QuestionsController < ApplicationController\n   before_action :authenticate_user!, except: [:index, :show]\n-  before_action :load_question, only: [:show, :edit, :update, :destroy]\n-  before_action :authors_only, only: [:edit, :update, :destroy]\n+  before_action :load_question, only: [:show, :update, :destroy]\n+  before_action :question_author_only, only: [:update, :destroy]\n \n   def index\n     @questions = Question.all\n   end\n \n-  def show\n-    @answers = @question.answers\n-  end\n+  def show; end\n \n   def new\n     @question = Question.new\n   end\n \n-  def edit; end\n-\n   def create\n-    params = question_params\n-    params[:user_id] = current_user.id if user_signed_in?\n-    @question = Question.new params\n+    question_params = resource_params\n+    question_params[:user_id] = current_user.id if user_signed_in?\n+    @question = Question.new question_params\n     if @question.save\n-      redirect_to @question, notice: t('question.success.created')\n+      redirect_to @question, notice: t('question.success.create')\n     else\n-      flash[:alert] = t('question.failure.not_created')\n+      flash[:alert] = t('question.failure.create')\n       render :new\n     end\n   end\n \n   def update\n-    if @question.update question_params\n-      redirect_to @question, notice: t('question.success.updated')\n-    else\n-      flash[:alert] = t('question.failure.not_updated')\n-      render :edit\n-    end\n+    @question.update resource_params\n   end\n \n   def destroy\n     @question.destroy\n-    redirect_to questions_path, notice: t('question.success.destroyed')\n+    respond_to do |format|\n+      format.html { redirect_to questions_path, notice: t('question.success.destroy') }","path":"app/controllers/questions_controller.rb","position":54,"original_position":54,"commit_id":"9d75d22333891e23a6cb246d02c3d413ee92d163","original_commit_id":"9d75d22333891e23a6cb246d02c3d413ee92d163","user":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars3.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"body":"Ок.\r\nДа, удаление из списка через ajax\r\nУдаление вопроса со страницы вопроса без ajax","created_at":"2017-03-19T18:07:09Z","updated_at":"2017-03-19T18:07:09Z","html_url":"https://github.com/anatoly-cmdx/tn1703/pull/16#discussion_r106813848","pull_request_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/comments/106813848"},"html":{"href":"https://github.com/anatoly-cmdx/tn1703/pull/16#discussion_r106813848"},"pull_request":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/16","id":111453622,"html_url":"https://github.com/anatoly-cmdx/tn1703/pull/16","diff_url":"https://github.com/anatoly-cmdx/tn1703/pull/16.diff","patch_url":"https://github.com/anatoly-cmdx/tn1703/pull/16.patch","issue_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues/16","number":16,"state":"open","locked":false,"title":"lesson 7. refactor question edit and answer edit to use ajax; add bes…","user":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars3.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"body":"…t answer","created_at":"2017-03-19T15:11:17Z","updated_at":"2017-03-19T18:07:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0af2296802e67759edc750a43b4aa8ef4ca754c9","assignee":{"login":"palkan","id":1516722,"avatar_url":"https://avatars1.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},"assignees":[{"login":"palkan","id":1516722,"avatar_url":"https://avatars1.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/anatoly-cmdx/tn1703/pulls/16/commits","review_comments_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/16/comments","review_comment_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/comments{/number}","comments_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues/16/comments","statuses_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/statuses/9d75d22333891e23a6cb246d02c3d413ee92d163","head":{"label":"anatoly-cmdx:lesson7","ref":"lesson7","sha":"9d75d22333891e23a6cb246d02c3d413ee92d163","user":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars3.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"repo":{"id":84110705,"name":"tn1703","full_name":"anatoly-cmdx/tn1703","owner":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars3.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anatoly-cmdx/tn1703","description":null,"fork":false,"url":"https://api.github.com/repos/anatoly-cmdx/tn1703","forks_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/forks","keys_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/teams","hooks_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/hooks","issue_events_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues/events{/number}","events_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/events","assignees_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/assignees{/user}","branches_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/branches{/branch}","tags_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/tags","blobs_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/refs{/sha}","trees_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/statuses/{sha}","languages_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/languages","stargazers_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/stargazers","contributors_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/contributors","subscribers_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/subscribers","subscription_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/subscription","commits_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/commits{/sha}","git_commits_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/commits{/sha}","comments_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/comments{/number}","issue_comment_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues/comments{/number}","contents_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/contents/{+path}","compare_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/merges","archive_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/downloads","issues_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues{/number}","pulls_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls{/number}","milestones_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/milestones{/number}","notifications_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/labels{/name}","releases_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/releases{/id}","deployments_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/deployments","created_at":"2017-03-06T19:12:37Z","updated_at":"2017-03-06T19:12:50Z","pushed_at":"2017-03-19T17:32:04Z","git_url":"git://github.com/anatoly-cmdx/tn1703.git","ssh_url":"git@github.com:anatoly-cmdx/tn1703.git","clone_url":"https://github.com/anatoly-cmdx/tn1703.git","svn_url":"https://github.com/anatoly-cmdx/tn1703","homepage":null,"size":115,"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":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"anatoly-cmdx:master","ref":"master","sha":"5a0075f57a1e0b6973eaef5b369e37f0fc88901f","user":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars3.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"repo":{"id":84110705,"name":"tn1703","full_name":"anatoly-cmdx/tn1703","owner":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars3.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anatoly-cmdx/tn1703","description":null,"fork":false,"url":"https://api.github.com/repos/anatoly-cmdx/tn1703","forks_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/forks","keys_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/teams","hooks_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/hooks","issue_events_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues/events{/number}","events_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/events","assignees_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/assignees{/user}","branches_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/branches{/branch}","tags_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/tags","blobs_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/refs{/sha}","trees_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/statuses/{sha}","languages_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/languages","stargazers_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/stargazers","contributors_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/contributors","subscribers_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/subscribers","subscription_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/subscription","commits_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/commits{/sha}","git_commits_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/git/commits{/sha}","comments_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/comments{/number}","issue_comment_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues/comments{/number}","contents_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/contents/{+path}","compare_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/merges","archive_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/downloads","issues_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues{/number}","pulls_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls{/number}","milestones_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/milestones{/number}","notifications_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/labels{/name}","releases_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/releases{/id}","deployments_url":"https://api.github.com/repos/anatoly-cmdx/tn1703/deployments","created_at":"2017-03-06T19:12:37Z","updated_at":"2017-03-06T19:12:50Z","pushed_at":"2017-03-19T17:32:04Z","git_url":"git://github.com/anatoly-cmdx/tn1703.git","ssh_url":"git@github.com:anatoly-cmdx/tn1703.git","clone_url":"https://github.com/anatoly-cmdx/tn1703.git","svn_url":"https://github.com/anatoly-cmdx/tn1703","homepage":null,"size":115,"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":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/16"},"html":{"href":"https://github.com/anatoly-cmdx/tn1703/pull/16"},"issue":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues/16"},"comments":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/anatoly-cmdx/tn1703/statuses/9d75d22333891e23a6cb246d02c3d413ee92d163"}}}}
{"actor":{"display_login":"anatoly-cmdx"}}