{"action":"created","comment":{"url":"https://api.github.com/repos/one0fnine/QnA/pulls/comments/66704007","id":66704007,"diff_hunk":"@@ -24,20 +24,34 @@\n               .links\n                 = link_to_add_association 'Add file', f, :attachments\n           .col-md-1= f.submit 'Update question', class: 'btn btn-success'\n+      .col-md-10.question-comments\n+        ul.list-unstyled>\n+          = render @question.comments\n+        - if current_user\n+          .row= form_for @question.comments.new, url: create_comment_question_path(@question),\n+                         remote: true,\n+                         html: {class: 'form-horizontal question-comments-form'} do |c|\n+            = c.label :body, class: 'sr-only'\n+            = c.text_area :body, class: 'form-control'\n+            = c.submit 'Add'\n \n-  .row.answers\n-    - if current_user\n-      .row= form_for [@question, @new_answer],\n-                           html: { class: 'form-horizontal new-answer' },\n-                           remote: true do |f|\n-        .col-md-2= f.label :body, 'New answer:'\n-        .col-md-8= f.text_area :body, class: 'form-control'\n-        .form-group\n-          = f.fields_for :attachments do |attach|\n-            = render 'attachment_fields', f: attach\n-            .links\n-              = link_to_add_association 'Add file', f, :attachments\n-        .col-md-1= f.submit 'Create', class: 'btn btn-success'\n+    .row.answers\n+      - if current_user\n+        .row= form_for [@question, @new_answer],\n+                             html: { class: 'form-horizontal new-answer' },\n+                             remote: true do |f|\n+          .col-md-2= f.label :body, 'New answer:'\n+          .col-md-8= f.text_area :body, class: 'form-control'\n+          .form-group\n+            = f.fields_for :attachments do |attach|\n+              = render 'attachment_fields', f: attach\n+              .links\n+                = link_to_add_association 'Add file', f, :attachments\n+          .col-md-1= f.submit 'Create', class: 'btn btn-success'\n+\n+      .answer\n+        = render @answers\n \n-    .answer\n-      = render @answers\n+  = subscribe_to \"/questions/comments\"","path":"app/views/questions/show.html.slim","position":54,"original_position":54,"commit_id":"4cb87437677b4b654e144f3b467634c42d8c69a3","original_commit_id":"4cb87437677b4b654e144f3b467634c42d8c69a3","user":{"login":"vkurennov","id":968537,"avatar_url":"https://avatars.githubusercontent.com/u/968537?v=3","gravatar_id":"","url":"https://api.github.com/users/vkurennov","html_url":"https://github.com/vkurennov","followers_url":"https://api.github.com/users/vkurennov/followers","following_url":"https://api.github.com/users/vkurennov/following{/other_user}","gists_url":"https://api.github.com/users/vkurennov/gists{/gist_id}","starred_url":"https://api.github.com/users/vkurennov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkurennov/subscriptions","organizations_url":"https://api.github.com/users/vkurennov/orgs","repos_url":"https://api.github.com/users/vkurennov/repos","events_url":"https://api.github.com/users/vkurennov/events{/privacy}","received_events_url":"https://api.github.com/users/vkurennov/received_events","type":"User","site_admin":false},"body":"У тебя общие каналы для комментариев к вопросу и ответу. Если у 2-х пользователей открыто 2 разные страницы с разными вопросами, то данные будут приходить в обе страницы, вне зависимости от того, к какому вопросу или овтету относится комментарий. Понятно, что в процессе обработки, если такого вопроса на странице нет, то просто ничего не произойдет, но как минимум будет поиск элемента в DOM, а это уже нагрузка. И в большинстве случаев она будет лишняя. Так что надо слать данные в тот канал, где есть нужный объект","created_at":"2016-06-11T09:55:44Z","updated_at":"2016-06-11T09:55:44Z","html_url":"https://github.com/one0fnine/QnA/pull/8#discussion_r66704007","pull_request_url":"https://api.github.com/repos/one0fnine/QnA/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/one0fnine/QnA/pulls/comments/66704007"},"html":{"href":"https://github.com/one0fnine/QnA/pull/8#discussion_r66704007"},"pull_request":{"href":"https://api.github.com/repos/one0fnine/QnA/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/one0fnine/QnA/pulls/8","id":73356747,"html_url":"https://github.com/one0fnine/QnA/pull/8","diff_url":"https://github.com/one0fnine/QnA/pull/8.diff","patch_url":"https://github.com/one0fnine/QnA/pull/8.patch","issue_url":"https://api.github.com/repos/one0fnine/QnA/issues/8","number":8,"state":"open","locked":false,"title":"feature/comments and comet","user":{"login":"one0fnine","id":7098834,"avatar_url":"https://avatars.githubusercontent.com/u/7098834?v=3","gravatar_id":"","url":"https://api.github.com/users/one0fnine","html_url":"https://github.com/one0fnine","followers_url":"https://api.github.com/users/one0fnine/followers","following_url":"https://api.github.com/users/one0fnine/following{/other_user}","gists_url":"https://api.github.com/users/one0fnine/gists{/gist_id}","starred_url":"https://api.github.com/users/one0fnine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/one0fnine/subscriptions","organizations_url":"https://api.github.com/users/one0fnine/orgs","repos_url":"https://api.github.com/users/one0fnine/repos","events_url":"https://api.github.com/users/one0fnine/events{/privacy}","received_events_url":"https://api.github.com/users/one0fnine/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-10T11:06:44Z","updated_at":"2016-06-11T09:55:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63a7883afd7f4121cff5d1c3759fcceb925193e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/one0fnine/QnA/pulls/8/commits","review_comments_url":"https://api.github.com/repos/one0fnine/QnA/pulls/8/comments","review_comment_url":"https://api.github.com/repos/one0fnine/QnA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/one0fnine/QnA/issues/8/comments","statuses_url":"https://api.github.com/repos/one0fnine/QnA/statuses/4cb87437677b4b654e144f3b467634c42d8c69a3","head":{"label":"one0fnine:feature/comments_and_comet","ref":"feature/comments_and_comet","sha":"4cb87437677b4b654e144f3b467634c42d8c69a3","user":{"login":"one0fnine","id":7098834,"avatar_url":"https://avatars.githubusercontent.com/u/7098834?v=3","gravatar_id":"","url":"https://api.github.com/users/one0fnine","html_url":"https://github.com/one0fnine","followers_url":"https://api.github.com/users/one0fnine/followers","following_url":"https://api.github.com/users/one0fnine/following{/other_user}","gists_url":"https://api.github.com/users/one0fnine/gists{/gist_id}","starred_url":"https://api.github.com/users/one0fnine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/one0fnine/subscriptions","organizations_url":"https://api.github.com/users/one0fnine/orgs","repos_url":"https://api.github.com/users/one0fnine/repos","events_url":"https://api.github.com/users/one0fnine/events{/privacy}","received_events_url":"https://api.github.com/users/one0fnine/received_events","type":"User","site_admin":false},"repo":{"id":57035511,"name":"QnA","full_name":"one0fnine/QnA","owner":{"login":"one0fnine","id":7098834,"avatar_url":"https://avatars.githubusercontent.com/u/7098834?v=3","gravatar_id":"","url":"https://api.github.com/users/one0fnine","html_url":"https://github.com/one0fnine","followers_url":"https://api.github.com/users/one0fnine/followers","following_url":"https://api.github.com/users/one0fnine/following{/other_user}","gists_url":"https://api.github.com/users/one0fnine/gists{/gist_id}","starred_url":"https://api.github.com/users/one0fnine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/one0fnine/subscriptions","organizations_url":"https://api.github.com/users/one0fnine/orgs","repos_url":"https://api.github.com/users/one0fnine/repos","events_url":"https://api.github.com/users/one0fnine/events{/privacy}","received_events_url":"https://api.github.com/users/one0fnine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/one0fnine/QnA","description":"","fork":false,"url":"https://api.github.com/repos/one0fnine/QnA","forks_url":"https://api.github.com/repos/one0fnine/QnA/forks","keys_url":"https://api.github.com/repos/one0fnine/QnA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/one0fnine/QnA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/one0fnine/QnA/teams","hooks_url":"https://api.github.com/repos/one0fnine/QnA/hooks","issue_events_url":"https://api.github.com/repos/one0fnine/QnA/issues/events{/number}","events_url":"https://api.github.com/repos/one0fnine/QnA/events","assignees_url":"https://api.github.com/repos/one0fnine/QnA/assignees{/user}","branches_url":"https://api.github.com/repos/one0fnine/QnA/branches{/branch}","tags_url":"https://api.github.com/repos/one0fnine/QnA/tags","blobs_url":"https://api.github.com/repos/one0fnine/QnA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/one0fnine/QnA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/one0fnine/QnA/git/refs{/sha}","trees_url":"https://api.github.com/repos/one0fnine/QnA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/one0fnine/QnA/statuses/{sha}","languages_url":"https://api.github.com/repos/one0fnine/QnA/languages","stargazers_url":"https://api.github.com/repos/one0fnine/QnA/stargazers","contributors_url":"https://api.github.com/repos/one0fnine/QnA/contributors","subscribers_url":"https://api.github.com/repos/one0fnine/QnA/subscribers","subscription_url":"https://api.github.com/repos/one0fnine/QnA/subscription","commits_url":"https://api.github.com/repos/one0fnine/QnA/commits{/sha}","git_commits_url":"https://api.github.com/repos/one0fnine/QnA/git/commits{/sha}","comments_url":"https://api.github.com/repos/one0fnine/QnA/comments{/number}","issue_comment_url":"https://api.github.com/repos/one0fnine/QnA/issues/comments{/number}","contents_url":"https://api.github.com/repos/one0fnine/QnA/contents/{+path}","compare_url":"https://api.github.com/repos/one0fnine/QnA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/one0fnine/QnA/merges","archive_url":"https://api.github.com/repos/one0fnine/QnA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/one0fnine/QnA/downloads","issues_url":"https://api.github.com/repos/one0fnine/QnA/issues{/number}","pulls_url":"https://api.github.com/repos/one0fnine/QnA/pulls{/number}","milestones_url":"https://api.github.com/repos/one0fnine/QnA/milestones{/number}","notifications_url":"https://api.github.com/repos/one0fnine/QnA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/one0fnine/QnA/labels{/name}","releases_url":"https://api.github.com/repos/one0fnine/QnA/releases{/id}","deployments_url":"https://api.github.com/repos/one0fnine/QnA/deployments","created_at":"2016-04-25T11:12:18Z","updated_at":"2016-04-25T11:25:02Z","pushed_at":"2016-06-10T11:06:44Z","git_url":"git://github.com/one0fnine/QnA.git","ssh_url":"git@github.com:one0fnine/QnA.git","clone_url":"https://github.com/one0fnine/QnA.git","svn_url":"https://github.com/one0fnine/QnA","homepage":null,"size":193,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"one0fnine:master","ref":"master","sha":"87eefaf49c3e340898a8bb1f0bdf7e6444c2141d","user":{"login":"one0fnine","id":7098834,"avatar_url":"https://avatars.githubusercontent.com/u/7098834?v=3","gravatar_id":"","url":"https://api.github.com/users/one0fnine","html_url":"https://github.com/one0fnine","followers_url":"https://api.github.com/users/one0fnine/followers","following_url":"https://api.github.com/users/one0fnine/following{/other_user}","gists_url":"https://api.github.com/users/one0fnine/gists{/gist_id}","starred_url":"https://api.github.com/users/one0fnine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/one0fnine/subscriptions","organizations_url":"https://api.github.com/users/one0fnine/orgs","repos_url":"https://api.github.com/users/one0fnine/repos","events_url":"https://api.github.com/users/one0fnine/events{/privacy}","received_events_url":"https://api.github.com/users/one0fnine/received_events","type":"User","site_admin":false},"repo":{"id":57035511,"name":"QnA","full_name":"one0fnine/QnA","owner":{"login":"one0fnine","id":7098834,"avatar_url":"https://avatars.githubusercontent.com/u/7098834?v=3","gravatar_id":"","url":"https://api.github.com/users/one0fnine","html_url":"https://github.com/one0fnine","followers_url":"https://api.github.com/users/one0fnine/followers","following_url":"https://api.github.com/users/one0fnine/following{/other_user}","gists_url":"https://api.github.com/users/one0fnine/gists{/gist_id}","starred_url":"https://api.github.com/users/one0fnine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/one0fnine/subscriptions","organizations_url":"https://api.github.com/users/one0fnine/orgs","repos_url":"https://api.github.com/users/one0fnine/repos","events_url":"https://api.github.com/users/one0fnine/events{/privacy}","received_events_url":"https://api.github.com/users/one0fnine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/one0fnine/QnA","description":"","fork":false,"url":"https://api.github.com/repos/one0fnine/QnA","forks_url":"https://api.github.com/repos/one0fnine/QnA/forks","keys_url":"https://api.github.com/repos/one0fnine/QnA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/one0fnine/QnA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/one0fnine/QnA/teams","hooks_url":"https://api.github.com/repos/one0fnine/QnA/hooks","issue_events_url":"https://api.github.com/repos/one0fnine/QnA/issues/events{/number}","events_url":"https://api.github.com/repos/one0fnine/QnA/events","assignees_url":"https://api.github.com/repos/one0fnine/QnA/assignees{/user}","branches_url":"https://api.github.com/repos/one0fnine/QnA/branches{/branch}","tags_url":"https://api.github.com/repos/one0fnine/QnA/tags","blobs_url":"https://api.github.com/repos/one0fnine/QnA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/one0fnine/QnA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/one0fnine/QnA/git/refs{/sha}","trees_url":"https://api.github.com/repos/one0fnine/QnA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/one0fnine/QnA/statuses/{sha}","languages_url":"https://api.github.com/repos/one0fnine/QnA/languages","stargazers_url":"https://api.github.com/repos/one0fnine/QnA/stargazers","contributors_url":"https://api.github.com/repos/one0fnine/QnA/contributors","subscribers_url":"https://api.github.com/repos/one0fnine/QnA/subscribers","subscription_url":"https://api.github.com/repos/one0fnine/QnA/subscription","commits_url":"https://api.github.com/repos/one0fnine/QnA/commits{/sha}","git_commits_url":"https://api.github.com/repos/one0fnine/QnA/git/commits{/sha}","comments_url":"https://api.github.com/repos/one0fnine/QnA/comments{/number}","issue_comment_url":"https://api.github.com/repos/one0fnine/QnA/issues/comments{/number}","contents_url":"https://api.github.com/repos/one0fnine/QnA/contents/{+path}","compare_url":"https://api.github.com/repos/one0fnine/QnA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/one0fnine/QnA/merges","archive_url":"https://api.github.com/repos/one0fnine/QnA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/one0fnine/QnA/downloads","issues_url":"https://api.github.com/repos/one0fnine/QnA/issues{/number}","pulls_url":"https://api.github.com/repos/one0fnine/QnA/pulls{/number}","milestones_url":"https://api.github.com/repos/one0fnine/QnA/milestones{/number}","notifications_url":"https://api.github.com/repos/one0fnine/QnA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/one0fnine/QnA/labels{/name}","releases_url":"https://api.github.com/repos/one0fnine/QnA/releases{/id}","deployments_url":"https://api.github.com/repos/one0fnine/QnA/deployments","created_at":"2016-04-25T11:12:18Z","updated_at":"2016-04-25T11:25:02Z","pushed_at":"2016-06-10T11:06:44Z","git_url":"git://github.com/one0fnine/QnA.git","ssh_url":"git@github.com:one0fnine/QnA.git","clone_url":"https://github.com/one0fnine/QnA.git","svn_url":"https://github.com/one0fnine/QnA","homepage":null,"size":193,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/one0fnine/QnA/pulls/8"},"html":{"href":"https://github.com/one0fnine/QnA/pull/8"},"issue":{"href":"https://api.github.com/repos/one0fnine/QnA/issues/8"},"comments":{"href":"https://api.github.com/repos/one0fnine/QnA/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/one0fnine/QnA/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/one0fnine/QnA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/one0fnine/QnA/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/one0fnine/QnA/statuses/4cb87437677b4b654e144f3b467634c42d8c69a3"}}}}
{"actor":{"display_login":"vkurennov"}}