{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/brs_41/pulls/comments/89964912","pull_request_review_id":10490847,"id":89964912,"diff_hunk":"@@ -0,0 +1,58 @@\n+class BooksController < ApplicationController\n+  before_action :book_load, only: [:index, :edit, :update, :destroy ]\n+\n+  def index\n+    @books=Book.paginate page: params[:page],per_page: Settings.ten\n+  end\n+\n+  def show\n+    @book=book_load\n+    @reviews=@book.review\n+    @rating=@book.rating\n+  end\n+\n+  def new\n+    @categories=Category.all\n+  end\n+\n+  def create\n+    book = Book.new book_params\n+    if book.save\n+      flash[:success] = t \"success_create\"\n+      redirect_to books_path\n+    else\n+      flash[:info] = t \"error_create\"\n+      render \"new\"\n+    end\n+  end\n+\n+  def edit\n+    @book = book_load\n+  end\n+\n+  def update\n+    book = book_load\n+    if book.update_attributes(book_params)\n+      flash[:success] = t \"update_success\"\n+      redirect_to books_path\n+    else\n+      flash[:error] = t \"update_error\"\n+      render :back\n+    end\n+  end\n+\n+  def destroy\n+    book_load.destroy\n+    flash[:success] = t \"delete_success\"\n+    redirect_to books_path\n+  end\n+\n+  private\n+  def book_params\n+    params.require(:book).permit(:title,:publish_date,:author,:num_of_page,:category_id,:image,rating:0)","path":"app/controllers/books_controller.rb","position":52,"original_position":52,"commit_id":"f5f1410ee30c6f01a08fdba8f2f3f3d6f49d9182","original_commit_id":"f5f1410ee30c6f01a08fdba8f2f3f3d6f49d9182","user":{"login":"phamvanbk11","id":10772245,"avatar_url":"https://avatars.githubusercontent.com/u/10772245?v=3","gravatar_id":"","url":"https://api.github.com/users/phamvanbk11","html_url":"https://github.com/phamvanbk11","followers_url":"https://api.github.com/users/phamvanbk11/followers","following_url":"https://api.github.com/users/phamvanbk11/following{/other_user}","gists_url":"https://api.github.com/users/phamvanbk11/gists{/gist_id}","starred_url":"https://api.github.com/users/phamvanbk11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamvanbk11/subscriptions","organizations_url":"https://api.github.com/users/phamvanbk11/orgs","repos_url":"https://api.github.com/users/phamvanbk11/repos","events_url":"https://api.github.com/users/phamvanbk11/events{/privacy}","received_events_url":"https://api.github.com/users/phamvanbk11/received_events","type":"User","site_admin":false},"body":"lỗi convention  \r\nsao lại cho rating:0 vào luôn vậy","created_at":"2016-11-29T09:02:39Z","updated_at":"2016-11-29T09:07:06Z","html_url":"https://github.com/framgia/brs_41/pull/8#discussion_r89964912","pull_request_url":"https://api.github.com/repos/framgia/brs_41/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/comments/89964912"},"html":{"href":"https://github.com/framgia/brs_41/pull/8#discussion_r89964912"},"pull_request":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/brs_41/pulls/8","id":95641642,"html_url":"https://github.com/framgia/brs_41/pull/8","diff_url":"https://github.com/framgia/brs_41/pull/8.diff","patch_url":"https://github.com/framgia/brs_41/pull/8.patch","issue_url":"https://api.github.com/repos/framgia/brs_41/issues/8","number":8,"state":"open","locked":false,"title":"done book","user":{"login":"kewdev","id":23021580,"avatar_url":"https://avatars.githubusercontent.com/u/23021580?v=3","gravatar_id":"","url":"https://api.github.com/users/kewdev","html_url":"https://github.com/kewdev","followers_url":"https://api.github.com/users/kewdev/followers","following_url":"https://api.github.com/users/kewdev/following{/other_user}","gists_url":"https://api.github.com/users/kewdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kewdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kewdev/subscriptions","organizations_url":"https://api.github.com/users/kewdev/orgs","repos_url":"https://api.github.com/users/kewdev/repos","events_url":"https://api.github.com/users/kewdev/events{/privacy}","received_events_url":"https://api.github.com/users/kewdev/received_events","type":"User","site_admin":false},"body":"cái push này của book em có nhiều hình và 1 chút css","created_at":"2016-11-29T07:49:44Z","updated_at":"2016-11-29T09:07:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"039bd47b3398fa8638160c55b363f2f01c38a954","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/brs_41/pulls/8/commits","review_comments_url":"https://api.github.com/repos/framgia/brs_41/pulls/8/comments","review_comment_url":"https://api.github.com/repos/framgia/brs_41/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/brs_41/issues/8/comments","statuses_url":"https://api.github.com/repos/framgia/brs_41/statuses/f5f1410ee30c6f01a08fdba8f2f3f3d6f49d9182","head":{"label":"kewdev:book","ref":"book","sha":"f5f1410ee30c6f01a08fdba8f2f3f3d6f49d9182","user":{"login":"kewdev","id":23021580,"avatar_url":"https://avatars.githubusercontent.com/u/23021580?v=3","gravatar_id":"","url":"https://api.github.com/users/kewdev","html_url":"https://github.com/kewdev","followers_url":"https://api.github.com/users/kewdev/followers","following_url":"https://api.github.com/users/kewdev/following{/other_user}","gists_url":"https://api.github.com/users/kewdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kewdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kewdev/subscriptions","organizations_url":"https://api.github.com/users/kewdev/orgs","repos_url":"https://api.github.com/users/kewdev/repos","events_url":"https://api.github.com/users/kewdev/events{/privacy}","received_events_url":"https://api.github.com/users/kewdev/received_events","type":"User","site_admin":false},"repo":{"id":75054675,"name":"brs_41","full_name":"kewdev/brs_41","owner":{"login":"kewdev","id":23021580,"avatar_url":"https://avatars.githubusercontent.com/u/23021580?v=3","gravatar_id":"","url":"https://api.github.com/users/kewdev","html_url":"https://github.com/kewdev","followers_url":"https://api.github.com/users/kewdev/followers","following_url":"https://api.github.com/users/kewdev/following{/other_user}","gists_url":"https://api.github.com/users/kewdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kewdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kewdev/subscriptions","organizations_url":"https://api.github.com/users/kewdev/orgs","repos_url":"https://api.github.com/users/kewdev/repos","events_url":"https://api.github.com/users/kewdev/events{/privacy}","received_events_url":"https://api.github.com/users/kewdev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kewdev/brs_41","description":null,"fork":true,"url":"https://api.github.com/repos/kewdev/brs_41","forks_url":"https://api.github.com/repos/kewdev/brs_41/forks","keys_url":"https://api.github.com/repos/kewdev/brs_41/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kewdev/brs_41/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kewdev/brs_41/teams","hooks_url":"https://api.github.com/repos/kewdev/brs_41/hooks","issue_events_url":"https://api.github.com/repos/kewdev/brs_41/issues/events{/number}","events_url":"https://api.github.com/repos/kewdev/brs_41/events","assignees_url":"https://api.github.com/repos/kewdev/brs_41/assignees{/user}","branches_url":"https://api.github.com/repos/kewdev/brs_41/branches{/branch}","tags_url":"https://api.github.com/repos/kewdev/brs_41/tags","blobs_url":"https://api.github.com/repos/kewdev/brs_41/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kewdev/brs_41/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kewdev/brs_41/git/refs{/sha}","trees_url":"https://api.github.com/repos/kewdev/brs_41/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kewdev/brs_41/statuses/{sha}","languages_url":"https://api.github.com/repos/kewdev/brs_41/languages","stargazers_url":"https://api.github.com/repos/kewdev/brs_41/stargazers","contributors_url":"https://api.github.com/repos/kewdev/brs_41/contributors","subscribers_url":"https://api.github.com/repos/kewdev/brs_41/subscribers","subscription_url":"https://api.github.com/repos/kewdev/brs_41/subscription","commits_url":"https://api.github.com/repos/kewdev/brs_41/commits{/sha}","git_commits_url":"https://api.github.com/repos/kewdev/brs_41/git/commits{/sha}","comments_url":"https://api.github.com/repos/kewdev/brs_41/comments{/number}","issue_comment_url":"https://api.github.com/repos/kewdev/brs_41/issues/comments{/number}","contents_url":"https://api.github.com/repos/kewdev/brs_41/contents/{+path}","compare_url":"https://api.github.com/repos/kewdev/brs_41/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kewdev/brs_41/merges","archive_url":"https://api.github.com/repos/kewdev/brs_41/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kewdev/brs_41/downloads","issues_url":"https://api.github.com/repos/kewdev/brs_41/issues{/number}","pulls_url":"https://api.github.com/repos/kewdev/brs_41/pulls{/number}","milestones_url":"https://api.github.com/repos/kewdev/brs_41/milestones{/number}","notifications_url":"https://api.github.com/repos/kewdev/brs_41/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kewdev/brs_41/labels{/name}","releases_url":"https://api.github.com/repos/kewdev/brs_41/releases{/id}","deployments_url":"https://api.github.com/repos/kewdev/brs_41/deployments","created_at":"2016-11-29T07:24:43Z","updated_at":"2016-11-16T04:29:55Z","pushed_at":"2016-11-29T07:49:15Z","git_url":"git://github.com/kewdev/brs_41.git","ssh_url":"git@github.com:kewdev/brs_41.git","clone_url":"https://github.com/kewdev/brs_41.git","svn_url":"https://github.com/kewdev/brs_41","homepage":null,"size":5747,"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":"93e1edce96a7f74b2c238449055fc18e737df60e","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":73884082,"name":"brs_41","full_name":"framgia/brs_41","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_41","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/brs_41","forks_url":"https://api.github.com/repos/framgia/brs_41/forks","keys_url":"https://api.github.com/repos/framgia/brs_41/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/brs_41/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/brs_41/teams","hooks_url":"https://api.github.com/repos/framgia/brs_41/hooks","issue_events_url":"https://api.github.com/repos/framgia/brs_41/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/brs_41/events","assignees_url":"https://api.github.com/repos/framgia/brs_41/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/brs_41/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/brs_41/tags","blobs_url":"https://api.github.com/repos/framgia/brs_41/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/brs_41/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/brs_41/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/brs_41/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/brs_41/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/brs_41/languages","stargazers_url":"https://api.github.com/repos/framgia/brs_41/stargazers","contributors_url":"https://api.github.com/repos/framgia/brs_41/contributors","subscribers_url":"https://api.github.com/repos/framgia/brs_41/subscribers","subscription_url":"https://api.github.com/repos/framgia/brs_41/subscription","commits_url":"https://api.github.com/repos/framgia/brs_41/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/brs_41/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/brs_41/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/brs_41/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/brs_41/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/brs_41/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/brs_41/merges","archive_url":"https://api.github.com/repos/framgia/brs_41/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/brs_41/downloads","issues_url":"https://api.github.com/repos/framgia/brs_41/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/brs_41/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/brs_41/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/brs_41/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/brs_41/labels{/name}","releases_url":"https://api.github.com/repos/framgia/brs_41/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/brs_41/deployments","created_at":"2016-11-16T04:29:55Z","updated_at":"2016-11-16T04:29:55Z","pushed_at":"2016-11-29T07:49:44Z","git_url":"git://github.com/framgia/brs_41.git","ssh_url":"git@github.com:framgia/brs_41.git","clone_url":"https://github.com/framgia/brs_41.git","svn_url":"https://github.com/framgia/brs_41","homepage":null,"size":1403,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/8"},"html":{"href":"https://github.com/framgia/brs_41/pull/8"},"issue":{"href":"https://api.github.com/repos/framgia/brs_41/issues/8"},"comments":{"href":"https://api.github.com/repos/framgia/brs_41/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/brs_41/statuses/f5f1410ee30c6f01a08fdba8f2f3f3d6f49d9182"}}}}
{"actor":{"display_login":"phamvanbk11"}}