{"action":"created","comment":{"url":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/comments/68491445","id":68491445,"diff_hunk":"@@ -3,7 +3,9 @@\n     $('.answers-errors-form').append('<%= j massage%>');\n   <% end %>\n <% else %>\n-  $('.answers').append('<%= j render 'answer', answer: @answer %>');\n+  <% publish_to \"/questions/#{@question.id}/answers\" do %>\n+    $('.answers').html('<%= j render 'answer', answer: @answer %>');","path":"app/views/answers/create.js.erb","position":6,"original_position":6,"commit_id":"25349605ce199cdec0b59ea9d8c35ae5eceab347","original_commit_id":"25349605ce199cdec0b59ea9d8c35ae5eceab347","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":"Такой вариант не подходит.\r\nШаблон будет рендерится перед тем, как отправится в _сокет_, во время рендеринга шаблона `create.js`, а значит в контексте текущего пользователя. Следовательно, итоговый HTML будет содержать ссылки для редактирования/удаления и форму – то, что должен видеть только автор.\r\n\r\nНужно переносить рендеринг на клиент и там уже делать отображение в зависимости от текущего пользователя.","created_at":"2016-06-25T17:46:13Z","updated_at":"2016-06-25T17:46:13Z","html_url":"https://github.com/liman-rpg/thinknetica/pull/10#discussion_r68491445","pull_request_url":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/comments/68491445"},"html":{"href":"https://github.com/liman-rpg/thinknetica/pull/10#discussion_r68491445"},"pull_request":{"href":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/10","id":75202585,"html_url":"https://github.com/liman-rpg/thinknetica/pull/10","diff_url":"https://github.com/liman-rpg/thinknetica/pull/10.diff","patch_url":"https://github.com/liman-rpg/thinknetica/pull/10.patch","issue_url":"https://api.github.com/repos/liman-rpg/thinknetica/issues/10","number":10,"state":"open","locked":false,"title":"Comet and pub/sub (#10)","user":{"login":"liman-rpg","id":15079126,"avatar_url":"https://avatars.githubusercontent.com/u/15079126?v=3","gravatar_id":"","url":"https://api.github.com/users/liman-rpg","html_url":"https://github.com/liman-rpg","followers_url":"https://api.github.com/users/liman-rpg/followers","following_url":"https://api.github.com/users/liman-rpg/following{/other_user}","gists_url":"https://api.github.com/users/liman-rpg/gists{/gist_id}","starred_url":"https://api.github.com/users/liman-rpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liman-rpg/subscriptions","organizations_url":"https://api.github.com/users/liman-rpg/orgs","repos_url":"https://api.github.com/users/liman-rpg/repos","events_url":"https://api.github.com/users/liman-rpg/events{/privacy}","received_events_url":"https://api.github.com/users/liman-rpg/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-25T11:23:56Z","updated_at":"2016-06-25T17:46:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e029dbb9c5f36aa45761906edeb25f69d4737bcc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/10/commits","review_comments_url":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/10/comments","review_comment_url":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/comments{/number}","comments_url":"https://api.github.com/repos/liman-rpg/thinknetica/issues/10/comments","statuses_url":"https://api.github.com/repos/liman-rpg/thinknetica/statuses/25349605ce199cdec0b59ea9d8c35ae5eceab347","head":{"label":"liman-rpg:comet_and_pub/sub","ref":"comet_and_pub/sub","sha":"25349605ce199cdec0b59ea9d8c35ae5eceab347","user":{"login":"liman-rpg","id":15079126,"avatar_url":"https://avatars.githubusercontent.com/u/15079126?v=3","gravatar_id":"","url":"https://api.github.com/users/liman-rpg","html_url":"https://github.com/liman-rpg","followers_url":"https://api.github.com/users/liman-rpg/followers","following_url":"https://api.github.com/users/liman-rpg/following{/other_user}","gists_url":"https://api.github.com/users/liman-rpg/gists{/gist_id}","starred_url":"https://api.github.com/users/liman-rpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liman-rpg/subscriptions","organizations_url":"https://api.github.com/users/liman-rpg/orgs","repos_url":"https://api.github.com/users/liman-rpg/repos","events_url":"https://api.github.com/users/liman-rpg/events{/privacy}","received_events_url":"https://api.github.com/users/liman-rpg/received_events","type":"User","site_admin":false},"repo":{"id":57330287,"name":"thinknetica","full_name":"liman-rpg/thinknetica","owner":{"login":"liman-rpg","id":15079126,"avatar_url":"https://avatars.githubusercontent.com/u/15079126?v=3","gravatar_id":"","url":"https://api.github.com/users/liman-rpg","html_url":"https://github.com/liman-rpg","followers_url":"https://api.github.com/users/liman-rpg/followers","following_url":"https://api.github.com/users/liman-rpg/following{/other_user}","gists_url":"https://api.github.com/users/liman-rpg/gists{/gist_id}","starred_url":"https://api.github.com/users/liman-rpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liman-rpg/subscriptions","organizations_url":"https://api.github.com/users/liman-rpg/orgs","repos_url":"https://api.github.com/users/liman-rpg/repos","events_url":"https://api.github.com/users/liman-rpg/events{/privacy}","received_events_url":"https://api.github.com/users/liman-rpg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liman-rpg/thinknetica","description":"","fork":false,"url":"https://api.github.com/repos/liman-rpg/thinknetica","forks_url":"https://api.github.com/repos/liman-rpg/thinknetica/forks","keys_url":"https://api.github.com/repos/liman-rpg/thinknetica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liman-rpg/thinknetica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liman-rpg/thinknetica/teams","hooks_url":"https://api.github.com/repos/liman-rpg/thinknetica/hooks","issue_events_url":"https://api.github.com/repos/liman-rpg/thinknetica/issues/events{/number}","events_url":"https://api.github.com/repos/liman-rpg/thinknetica/events","assignees_url":"https://api.github.com/repos/liman-rpg/thinknetica/assignees{/user}","branches_url":"https://api.github.com/repos/liman-rpg/thinknetica/branches{/branch}","tags_url":"https://api.github.com/repos/liman-rpg/thinknetica/tags","blobs_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/refs{/sha}","trees_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liman-rpg/thinknetica/statuses/{sha}","languages_url":"https://api.github.com/repos/liman-rpg/thinknetica/languages","stargazers_url":"https://api.github.com/repos/liman-rpg/thinknetica/stargazers","contributors_url":"https://api.github.com/repos/liman-rpg/thinknetica/contributors","subscribers_url":"https://api.github.com/repos/liman-rpg/thinknetica/subscribers","subscription_url":"https://api.github.com/repos/liman-rpg/thinknetica/subscription","commits_url":"https://api.github.com/repos/liman-rpg/thinknetica/commits{/sha}","git_commits_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/commits{/sha}","comments_url":"https://api.github.com/repos/liman-rpg/thinknetica/comments{/number}","issue_comment_url":"https://api.github.com/repos/liman-rpg/thinknetica/issues/comments{/number}","contents_url":"https://api.github.com/repos/liman-rpg/thinknetica/contents/{+path}","compare_url":"https://api.github.com/repos/liman-rpg/thinknetica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liman-rpg/thinknetica/merges","archive_url":"https://api.github.com/repos/liman-rpg/thinknetica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liman-rpg/thinknetica/downloads","issues_url":"https://api.github.com/repos/liman-rpg/thinknetica/issues{/number}","pulls_url":"https://api.github.com/repos/liman-rpg/thinknetica/pulls{/number}","milestones_url":"https://api.github.com/repos/liman-rpg/thinknetica/milestones{/number}","notifications_url":"https://api.github.com/repos/liman-rpg/thinknetica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liman-rpg/thinknetica/labels{/name}","releases_url":"https://api.github.com/repos/liman-rpg/thinknetica/releases{/id}","deployments_url":"https://api.github.com/repos/liman-rpg/thinknetica/deployments","created_at":"2016-04-28T20:03:04Z","updated_at":"2016-04-28T20:05:14Z","pushed_at":"2016-06-25T11:23:57Z","git_url":"git://github.com/liman-rpg/thinknetica.git","ssh_url":"git@github.com:liman-rpg/thinknetica.git","clone_url":"https://github.com/liman-rpg/thinknetica.git","svn_url":"https://github.com/liman-rpg/thinknetica","homepage":null,"size":187,"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":"liman-rpg:master","ref":"master","sha":"b149bc7f5fe7950380b5e965bb01c5f566c0b6fb","user":{"login":"liman-rpg","id":15079126,"avatar_url":"https://avatars.githubusercontent.com/u/15079126?v=3","gravatar_id":"","url":"https://api.github.com/users/liman-rpg","html_url":"https://github.com/liman-rpg","followers_url":"https://api.github.com/users/liman-rpg/followers","following_url":"https://api.github.com/users/liman-rpg/following{/other_user}","gists_url":"https://api.github.com/users/liman-rpg/gists{/gist_id}","starred_url":"https://api.github.com/users/liman-rpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liman-rpg/subscriptions","organizations_url":"https://api.github.com/users/liman-rpg/orgs","repos_url":"https://api.github.com/users/liman-rpg/repos","events_url":"https://api.github.com/users/liman-rpg/events{/privacy}","received_events_url":"https://api.github.com/users/liman-rpg/received_events","type":"User","site_admin":false},"repo":{"id":57330287,"name":"thinknetica","full_name":"liman-rpg/thinknetica","owner":{"login":"liman-rpg","id":15079126,"avatar_url":"https://avatars.githubusercontent.com/u/15079126?v=3","gravatar_id":"","url":"https://api.github.com/users/liman-rpg","html_url":"https://github.com/liman-rpg","followers_url":"https://api.github.com/users/liman-rpg/followers","following_url":"https://api.github.com/users/liman-rpg/following{/other_user}","gists_url":"https://api.github.com/users/liman-rpg/gists{/gist_id}","starred_url":"https://api.github.com/users/liman-rpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liman-rpg/subscriptions","organizations_url":"https://api.github.com/users/liman-rpg/orgs","repos_url":"https://api.github.com/users/liman-rpg/repos","events_url":"https://api.github.com/users/liman-rpg/events{/privacy}","received_events_url":"https://api.github.com/users/liman-rpg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liman-rpg/thinknetica","description":"","fork":false,"url":"https://api.github.com/repos/liman-rpg/thinknetica","forks_url":"https://api.github.com/repos/liman-rpg/thinknetica/forks","keys_url":"https://api.github.com/repos/liman-rpg/thinknetica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liman-rpg/thinknetica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liman-rpg/thinknetica/teams","hooks_url":"https://api.github.com/repos/liman-rpg/thinknetica/hooks","issue_events_url":"https://api.github.com/repos/liman-rpg/thinknetica/issues/events{/number}","events_url":"https://api.github.com/repos/liman-rpg/thinknetica/events","assignees_url":"https://api.github.com/repos/liman-rpg/thinknetica/assignees{/user}","branches_url":"https://api.github.com/repos/liman-rpg/thinknetica/branches{/branch}","tags_url":"https://api.github.com/repos/liman-rpg/thinknetica/tags","blobs_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/refs{/sha}","trees_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liman-rpg/thinknetica/statuses/{sha}","languages_url":"https://api.github.com/repos/liman-rpg/thinknetica/languages","stargazers_url":"https://api.github.com/repos/liman-rpg/thinknetica/stargazers","contributors_url":"https://api.github.com/repos/liman-rpg/thinknetica/contributors","subscribers_url":"https://api.github.com/repos/liman-rpg/thinknetica/subscribers","subscription_url":"https://api.github.com/repos/liman-rpg/thinknetica/subscription","commits_url":"https://api.github.com/repos/liman-rpg/thinknetica/commits{/sha}","git_commits_url":"https://api.github.com/repos/liman-rpg/thinknetica/git/commits{/sha}","comments_url":"https://api.github.com/repos/liman-rpg/thinknetica/comments{/number}","issue_comment_url":"https://api.github.com/repos/liman-rpg/thinknetica/issues/comments{/number}","contents_url":"https://api.github.com/repos/liman-rpg/thinknetica/contents/{+path}","compare_url":"https://api.github.com/repos/liman-rpg/thinknetica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liman-rpg/thinknetica/merges","archive_url":"https://api.github.com/repos/liman-rpg/thinknetica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liman-rpg/thinknetica/downloads","issues_url":"https://api.github.com/repos/liman-rpg/thinknetica/issues{/number}","pulls_url":"https://api.github.com/repos/liman-rpg/thinknetica/pulls{/number}","milestones_url":"https://api.github.com/repos/liman-rpg/thinknetica/milestones{/number}","notifications_url":"https://api.github.com/repos/liman-rpg/thinknetica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liman-rpg/thinknetica/labels{/name}","releases_url":"https://api.github.com/repos/liman-rpg/thinknetica/releases{/id}","deployments_url":"https://api.github.com/repos/liman-rpg/thinknetica/deployments","created_at":"2016-04-28T20:03:04Z","updated_at":"2016-04-28T20:05:14Z","pushed_at":"2016-06-25T11:23:57Z","git_url":"git://github.com/liman-rpg/thinknetica.git","ssh_url":"git@github.com:liman-rpg/thinknetica.git","clone_url":"https://github.com/liman-rpg/thinknetica.git","svn_url":"https://github.com/liman-rpg/thinknetica","homepage":null,"size":187,"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/liman-rpg/thinknetica/pulls/10"},"html":{"href":"https://github.com/liman-rpg/thinknetica/pull/10"},"issue":{"href":"https://api.github.com/repos/liman-rpg/thinknetica/issues/10"},"comments":{"href":"https://api.github.com/repos/liman-rpg/thinknetica/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/liman-rpg/thinknetica/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/liman-rpg/thinknetica/statuses/25349605ce199cdec0b59ea9d8c35ae5eceab347"}}}}
{"actor":{"display_login":"palkan"}}