{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fdf_10/pulls/comments/77932570","id":77932570,"diff_hunk":"@@ -19,9 +20,38 @@ def create\n     end\n   end\n \n+  def destroy\n+    if @category.destroy\n+      flash.now[:success] = t \"admin.categories.destroy.success\"\n+    end\n+    respond_to do |format|\n+      format.json do\n+        render json:{\n+          flash: flash\n+        }\n+      end\n+    end\n+  end\n+\n+  def edit\n+  end\n+\n+  def update\n+    if @category.update_attributes category_params\n+      flash[:success] = t \"flash.success.update\"\n+      redirect_to admin_categories_path\n+    else\n+      render :edit\n+    end\n+  end\n+\n   private\n \n   def category_params\n     params.require(:category).permit :name, :description\n   end\n+\n+  def load_category\n+    @category = Category.find_by id: params[:id]","path":"app/controllers/admin/categories_controller.rb","position":42,"original_position":42,"commit_id":"35c0a3c6a1b0a2739f9f84ea4ffd008a8f36065f","original_commit_id":"35c0a3c6a1b0a2739f9f84ea4ffd008a8f36065f","user":{"login":"thangtx88","id":18256324,"avatar_url":"https://avatars.githubusercontent.com/u/18256324?v=3","gravatar_id":"","url":"https://api.github.com/users/thangtx88","html_url":"https://github.com/thangtx88","followers_url":"https://api.github.com/users/thangtx88/followers","following_url":"https://api.github.com/users/thangtx88/following{/other_user}","gists_url":"https://api.github.com/users/thangtx88/gists{/gist_id}","starred_url":"https://api.github.com/users/thangtx88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangtx88/subscriptions","organizations_url":"https://api.github.com/users/thangtx88/orgs","repos_url":"https://api.github.com/users/thangtx88/repos","events_url":"https://api.github.com/users/thangtx88/events{/privacy}","received_events_url":"https://api.github.com/users/thangtx88/received_events","type":"User","site_admin":false},"body":"nếu  @category=nil thì ?","created_at":"2016-09-08T01:13:03Z","updated_at":"2016-09-08T01:13:03Z","html_url":"https://github.com/framgia/fdf_10/pull/4#discussion_r77932570","pull_request_url":"https://api.github.com/repos/framgia/fdf_10/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/framgia/fdf_10/pulls/comments/77932570"},"html":{"href":"https://github.com/framgia/fdf_10/pull/4#discussion_r77932570"},"pull_request":{"href":"https://api.github.com/repos/framgia/fdf_10/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fdf_10/pulls/4","id":84399527,"html_url":"https://github.com/framgia/fdf_10/pull/4","diff_url":"https://github.com/framgia/fdf_10/pull/4.diff","patch_url":"https://github.com/framgia/fdf_10/pull/4.patch","issue_url":"https://api.github.com/repos/framgia/fdf_10/issues/4","number":4,"state":"open","locked":false,"title":"76103 edit and delete category","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":"","created_at":"2016-09-08T01:10:08Z","updated_at":"2016-09-08T01:13:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48937e902ff12a3179187f3ca499ffeabb3b90db","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fdf_10/pulls/4/commits","review_comments_url":"https://api.github.com/repos/framgia/fdf_10/pulls/4/comments","review_comment_url":"https://api.github.com/repos/framgia/fdf_10/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fdf_10/issues/4/comments","statuses_url":"https://api.github.com/repos/framgia/fdf_10/statuses/35c0a3c6a1b0a2739f9f84ea4ffd008a8f36065f","head":{"label":"phamvanbk11:76103_edit_and_delete_category","ref":"76103_edit_and_delete_category","sha":"35c0a3c6a1b0a2739f9f84ea4ffd008a8f36065f","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},"repo":{"id":67566625,"name":"fdf_10","full_name":"phamvanbk11/fdf_10","owner":{"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},"private":false,"html_url":"https://github.com/phamvanbk11/fdf_10","description":"Foods & Drinks (training)","fork":true,"url":"https://api.github.com/repos/phamvanbk11/fdf_10","forks_url":"https://api.github.com/repos/phamvanbk11/fdf_10/forks","keys_url":"https://api.github.com/repos/phamvanbk11/fdf_10/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phamvanbk11/fdf_10/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phamvanbk11/fdf_10/teams","hooks_url":"https://api.github.com/repos/phamvanbk11/fdf_10/hooks","issue_events_url":"https://api.github.com/repos/phamvanbk11/fdf_10/issues/events{/number}","events_url":"https://api.github.com/repos/phamvanbk11/fdf_10/events","assignees_url":"https://api.github.com/repos/phamvanbk11/fdf_10/assignees{/user}","branches_url":"https://api.github.com/repos/phamvanbk11/fdf_10/branches{/branch}","tags_url":"https://api.github.com/repos/phamvanbk11/fdf_10/tags","blobs_url":"https://api.github.com/repos/phamvanbk11/fdf_10/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phamvanbk11/fdf_10/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phamvanbk11/fdf_10/git/refs{/sha}","trees_url":"https://api.github.com/repos/phamvanbk11/fdf_10/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phamvanbk11/fdf_10/statuses/{sha}","languages_url":"https://api.github.com/repos/phamvanbk11/fdf_10/languages","stargazers_url":"https://api.github.com/repos/phamvanbk11/fdf_10/stargazers","contributors_url":"https://api.github.com/repos/phamvanbk11/fdf_10/contributors","subscribers_url":"https://api.github.com/repos/phamvanbk11/fdf_10/subscribers","subscription_url":"https://api.github.com/repos/phamvanbk11/fdf_10/subscription","commits_url":"https://api.github.com/repos/phamvanbk11/fdf_10/commits{/sha}","git_commits_url":"https://api.github.com/repos/phamvanbk11/fdf_10/git/commits{/sha}","comments_url":"https://api.github.com/repos/phamvanbk11/fdf_10/comments{/number}","issue_comment_url":"https://api.github.com/repos/phamvanbk11/fdf_10/issues/comments{/number}","contents_url":"https://api.github.com/repos/phamvanbk11/fdf_10/contents/{+path}","compare_url":"https://api.github.com/repos/phamvanbk11/fdf_10/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phamvanbk11/fdf_10/merges","archive_url":"https://api.github.com/repos/phamvanbk11/fdf_10/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phamvanbk11/fdf_10/downloads","issues_url":"https://api.github.com/repos/phamvanbk11/fdf_10/issues{/number}","pulls_url":"https://api.github.com/repos/phamvanbk11/fdf_10/pulls{/number}","milestones_url":"https://api.github.com/repos/phamvanbk11/fdf_10/milestones{/number}","notifications_url":"https://api.github.com/repos/phamvanbk11/fdf_10/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phamvanbk11/fdf_10/labels{/name}","releases_url":"https://api.github.com/repos/phamvanbk11/fdf_10/releases{/id}","deployments_url":"https://api.github.com/repos/phamvanbk11/fdf_10/deployments","created_at":"2016-09-07T02:57:27Z","updated_at":"2016-07-26T00:12:14Z","pushed_at":"2016-09-08T01:08:18Z","git_url":"git://github.com/phamvanbk11/fdf_10.git","ssh_url":"git@github.com:phamvanbk11/fdf_10.git","clone_url":"https://github.com/phamvanbk11/fdf_10.git","svn_url":"https://github.com/phamvanbk11/fdf_10","homepage":null,"size":36,"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":"3a49f0f3e1a0d7bce1f159662a1338126d45efb3","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":64176198,"name":"fdf_10","full_name":"framgia/fdf_10","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/fdf_10","description":"Foods & Drinks (training)","fork":false,"url":"https://api.github.com/repos/framgia/fdf_10","forks_url":"https://api.github.com/repos/framgia/fdf_10/forks","keys_url":"https://api.github.com/repos/framgia/fdf_10/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fdf_10/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fdf_10/teams","hooks_url":"https://api.github.com/repos/framgia/fdf_10/hooks","issue_events_url":"https://api.github.com/repos/framgia/fdf_10/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fdf_10/events","assignees_url":"https://api.github.com/repos/framgia/fdf_10/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fdf_10/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fdf_10/tags","blobs_url":"https://api.github.com/repos/framgia/fdf_10/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fdf_10/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fdf_10/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fdf_10/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fdf_10/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fdf_10/languages","stargazers_url":"https://api.github.com/repos/framgia/fdf_10/stargazers","contributors_url":"https://api.github.com/repos/framgia/fdf_10/contributors","subscribers_url":"https://api.github.com/repos/framgia/fdf_10/subscribers","subscription_url":"https://api.github.com/repos/framgia/fdf_10/subscription","commits_url":"https://api.github.com/repos/framgia/fdf_10/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fdf_10/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fdf_10/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fdf_10/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fdf_10/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fdf_10/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fdf_10/merges","archive_url":"https://api.github.com/repos/framgia/fdf_10/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fdf_10/downloads","issues_url":"https://api.github.com/repos/framgia/fdf_10/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fdf_10/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fdf_10/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fdf_10/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fdf_10/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fdf_10/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fdf_10/deployments","created_at":"2016-07-26T00:12:14Z","updated_at":"2016-07-26T00:12:14Z","pushed_at":"2016-09-08T01:10:08Z","git_url":"git://github.com/framgia/fdf_10.git","ssh_url":"git@github.com:framgia/fdf_10.git","clone_url":"https://github.com/framgia/fdf_10.git","svn_url":"https://github.com/framgia/fdf_10","homepage":null,"size":36,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fdf_10/pulls/4"},"html":{"href":"https://github.com/framgia/fdf_10/pull/4"},"issue":{"href":"https://api.github.com/repos/framgia/fdf_10/issues/4"},"comments":{"href":"https://api.github.com/repos/framgia/fdf_10/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fdf_10/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fdf_10/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fdf_10/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fdf_10/statuses/35c0a3c6a1b0a2739f9f84ea4ffd008a8f36065f"}}}}
{"actor":{"display_login":"thangtx88"}}