{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/brs_6/pulls/comments/28217519","id":28217519,"diff_hunk":"@@ -0,0 +1,30 @@\n+class ReviewsController < ApplicationController\n+\n+  def create\n+    @book = Book.find params[:book_id]\n+    @review = @book.reviews.build review_params\n+\n+    if @review.save\n+      @new_review = @book.reviews.new\n+      respond_to do |format|\n+        format.html do\n+          flash[:success] = 'Your review has been booked.'\n+          redirect_to @book\n+        end\n+        format.js\n+      end\n+    else\n+      @new_review = @review\n+      respond_to do |format|\n+        format.html { render @book }","path":"app/controllers/reviews_controller.rb","position":19,"original_position":19,"commit_id":"1efba7e3009468fea120e51719895d9e8b011faa","original_commit_id":"1efba7e3009468fea120e51719895d9e8b011faa","user":{"login":"dieunb","id":2122175,"avatar_url":"https://avatars.githubusercontent.com/u/2122175?v=3","gravatar_id":"","url":"https://api.github.com/users/dieunb","html_url":"https://github.com/dieunb","followers_url":"https://api.github.com/users/dieunb/followers","following_url":"https://api.github.com/users/dieunb/following{/other_user}","gists_url":"https://api.github.com/users/dieunb/gists{/gist_id}","starred_url":"https://api.github.com/users/dieunb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dieunb/subscriptions","organizations_url":"https://api.github.com/users/dieunb/orgs","repos_url":"https://api.github.com/users/dieunb/repos","events_url":"https://api.github.com/users/dieunb/events{/privacy}","received_events_url":"https://api.github.com/users/dieunb/received_events","type":"User","site_admin":false},"body":"coding convention","created_at":"2015-04-13T06:50:21Z","updated_at":"2015-04-13T06:50:21Z","html_url":"https://github.com/framgia/brs_6/pull/13#discussion_r28217519","pull_request_url":"https://api.github.com/repos/framgia/brs_6/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_6/pulls/comments/28217519"},"html":{"href":"https://github.com/framgia/brs_6/pull/13#discussion_r28217519"},"pull_request":{"href":"https://api.github.com/repos/framgia/brs_6/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/brs_6/pulls/13","id":33135458,"html_url":"https://github.com/framgia/brs_6/pull/13","diff_url":"https://github.com/framgia/brs_6/pull/13.diff","patch_url":"https://github.com/framgia/brs_6/pull/13.patch","issue_url":"https://api.github.com/repos/framgia/brs_6/issues/13","number":13,"state":"open","locked":false,"title":"create review using ajax","user":{"login":"biznezo","id":6303756,"avatar_url":"https://avatars.githubusercontent.com/u/6303756?v=3","gravatar_id":"","url":"https://api.github.com/users/biznezo","html_url":"https://github.com/biznezo","followers_url":"https://api.github.com/users/biznezo/followers","following_url":"https://api.github.com/users/biznezo/following{/other_user}","gists_url":"https://api.github.com/users/biznezo/gists{/gist_id}","starred_url":"https://api.github.com/users/biznezo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biznezo/subscriptions","organizations_url":"https://api.github.com/users/biznezo/orgs","repos_url":"https://api.github.com/users/biznezo/repos","events_url":"https://api.github.com/users/biznezo/events{/privacy}","received_events_url":"https://api.github.com/users/biznezo/received_events","type":"User","site_admin":false},"body":"dsada","created_at":"2015-04-13T04:40:26Z","updated_at":"2015-04-13T06:50:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb0e21a9d3ebf8ebed4cef460759f6831d3d8b33","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/brs_6/pulls/13/commits","review_comments_url":"https://api.github.com/repos/framgia/brs_6/pulls/13/comments","review_comment_url":"https://api.github.com/repos/framgia/brs_6/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/brs_6/issues/13/comments","statuses_url":"https://api.github.com/repos/framgia/brs_6/statuses/1efba7e3009468fea120e51719895d9e8b011faa","head":{"label":"biznezo:create_review","ref":"create_review","sha":"1efba7e3009468fea120e51719895d9e8b011faa","user":{"login":"biznezo","id":6303756,"avatar_url":"https://avatars.githubusercontent.com/u/6303756?v=3","gravatar_id":"","url":"https://api.github.com/users/biznezo","html_url":"https://github.com/biznezo","followers_url":"https://api.github.com/users/biznezo/followers","following_url":"https://api.github.com/users/biznezo/following{/other_user}","gists_url":"https://api.github.com/users/biznezo/gists{/gist_id}","starred_url":"https://api.github.com/users/biznezo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biznezo/subscriptions","organizations_url":"https://api.github.com/users/biznezo/orgs","repos_url":"https://api.github.com/users/biznezo/repos","events_url":"https://api.github.com/users/biznezo/events{/privacy}","received_events_url":"https://api.github.com/users/biznezo/received_events","type":"User","site_admin":false},"repo":{"id":32441973,"name":"brs_6","full_name":"biznezo/brs_6","owner":{"login":"biznezo","id":6303756,"avatar_url":"https://avatars.githubusercontent.com/u/6303756?v=3","gravatar_id":"","url":"https://api.github.com/users/biznezo","html_url":"https://github.com/biznezo","followers_url":"https://api.github.com/users/biznezo/followers","following_url":"https://api.github.com/users/biznezo/following{/other_user}","gists_url":"https://api.github.com/users/biznezo/gists{/gist_id}","starred_url":"https://api.github.com/users/biznezo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biznezo/subscriptions","organizations_url":"https://api.github.com/users/biznezo/orgs","repos_url":"https://api.github.com/users/biznezo/repos","events_url":"https://api.github.com/users/biznezo/events{/privacy}","received_events_url":"https://api.github.com/users/biznezo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/biznezo/brs_6","description":"Book Reviewing System (training)","fork":true,"url":"https://api.github.com/repos/biznezo/brs_6","forks_url":"https://api.github.com/repos/biznezo/brs_6/forks","keys_url":"https://api.github.com/repos/biznezo/brs_6/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biznezo/brs_6/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biznezo/brs_6/teams","hooks_url":"https://api.github.com/repos/biznezo/brs_6/hooks","issue_events_url":"https://api.github.com/repos/biznezo/brs_6/issues/events{/number}","events_url":"https://api.github.com/repos/biznezo/brs_6/events","assignees_url":"https://api.github.com/repos/biznezo/brs_6/assignees{/user}","branches_url":"https://api.github.com/repos/biznezo/brs_6/branches{/branch}","tags_url":"https://api.github.com/repos/biznezo/brs_6/tags","blobs_url":"https://api.github.com/repos/biznezo/brs_6/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biznezo/brs_6/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biznezo/brs_6/git/refs{/sha}","trees_url":"https://api.github.com/repos/biznezo/brs_6/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biznezo/brs_6/statuses/{sha}","languages_url":"https://api.github.com/repos/biznezo/brs_6/languages","stargazers_url":"https://api.github.com/repos/biznezo/brs_6/stargazers","contributors_url":"https://api.github.com/repos/biznezo/brs_6/contributors","subscribers_url":"https://api.github.com/repos/biznezo/brs_6/subscribers","subscription_url":"https://api.github.com/repos/biznezo/brs_6/subscription","commits_url":"https://api.github.com/repos/biznezo/brs_6/commits{/sha}","git_commits_url":"https://api.github.com/repos/biznezo/brs_6/git/commits{/sha}","comments_url":"https://api.github.com/repos/biznezo/brs_6/comments{/number}","issue_comment_url":"https://api.github.com/repos/biznezo/brs_6/issues/comments{/number}","contents_url":"https://api.github.com/repos/biznezo/brs_6/contents/{+path}","compare_url":"https://api.github.com/repos/biznezo/brs_6/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biznezo/brs_6/merges","archive_url":"https://api.github.com/repos/biznezo/brs_6/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biznezo/brs_6/downloads","issues_url":"https://api.github.com/repos/biznezo/brs_6/issues{/number}","pulls_url":"https://api.github.com/repos/biznezo/brs_6/pulls{/number}","milestones_url":"https://api.github.com/repos/biznezo/brs_6/milestones{/number}","notifications_url":"https://api.github.com/repos/biznezo/brs_6/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biznezo/brs_6/labels{/name}","releases_url":"https://api.github.com/repos/biznezo/brs_6/releases{/id}","created_at":"2015-03-18T06:32:02Z","updated_at":"2015-03-13T09:33:49Z","pushed_at":"2015-04-13T05:16:59Z","git_url":"git://github.com/biznezo/brs_6.git","ssh_url":"git@github.com:biznezo/brs_6.git","clone_url":"https://github.com/biznezo/brs_6.git","svn_url":"https://github.com/biznezo/brs_6","homepage":null,"size":161,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"framgia:develop","ref":"develop","sha":"927f5dedc71f8f4e5b788787f7577173531b5c2e","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":32147467,"name":"brs_6","full_name":"framgia/brs_6","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/brs_6","description":"Book Reviewing System (training)","fork":false,"url":"https://api.github.com/repos/framgia/brs_6","forks_url":"https://api.github.com/repos/framgia/brs_6/forks","keys_url":"https://api.github.com/repos/framgia/brs_6/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/brs_6/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/brs_6/teams","hooks_url":"https://api.github.com/repos/framgia/brs_6/hooks","issue_events_url":"https://api.github.com/repos/framgia/brs_6/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/brs_6/events","assignees_url":"https://api.github.com/repos/framgia/brs_6/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/brs_6/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/brs_6/tags","blobs_url":"https://api.github.com/repos/framgia/brs_6/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/brs_6/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/brs_6/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/brs_6/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/brs_6/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/brs_6/languages","stargazers_url":"https://api.github.com/repos/framgia/brs_6/stargazers","contributors_url":"https://api.github.com/repos/framgia/brs_6/contributors","subscribers_url":"https://api.github.com/repos/framgia/brs_6/subscribers","subscription_url":"https://api.github.com/repos/framgia/brs_6/subscription","commits_url":"https://api.github.com/repos/framgia/brs_6/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/brs_6/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/brs_6/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/brs_6/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/brs_6/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/brs_6/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/brs_6/merges","archive_url":"https://api.github.com/repos/framgia/brs_6/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/brs_6/downloads","issues_url":"https://api.github.com/repos/framgia/brs_6/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/brs_6/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/brs_6/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/brs_6/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/brs_6/labels{/name}","releases_url":"https://api.github.com/repos/framgia/brs_6/releases{/id}","created_at":"2015-03-13T09:33:49Z","updated_at":"2015-03-13T09:33:49Z","pushed_at":"2015-04-13T05:16:59Z","git_url":"git://github.com/framgia/brs_6.git","ssh_url":"git@github.com:framgia/brs_6.git","clone_url":"https://github.com/framgia/brs_6.git","svn_url":"https://github.com/framgia/brs_6","homepage":null,"size":310,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_6/pulls/13"},"html":{"href":"https://github.com/framgia/brs_6/pull/13"},"issue":{"href":"https://api.github.com/repos/framgia/brs_6/issues/13"},"comments":{"href":"https://api.github.com/repos/framgia/brs_6/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/brs_6/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/brs_6/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/brs_6/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/brs_6/statuses/1efba7e3009468fea120e51719895d9e8b011faa"}}}}