{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_56/pulls/comments/30098677","id":30098677,"diff_hunk":"@@ -1,4 +1,54 @@\n class WordsController < ApplicationController\n   def index\n+    @answers = Word.answer_correct.paginate page: params[:page], per_page: 20\n   end\n+\n+  def create   \n+    @word = Word.new word_params\n+    if @word.save\n+      flash[:success] = I18n.t :create_success\n+      redirect_to words_path\n+    else\n+      render \"new\"\n+    end\n+  end\n+\n+  def new\n+    @word = Word.new\n+    4.times do\n+      answer = @word.answers.build\n+    end\n+  end\n+\n+  def edit\n+    @word = Word.find params[:id]\n+  end\n+\n+  def update\n+    @word = Word.find params[:id]\n+    if @word.update_attributes word_params\n+      flash[:success] = I18n.t :update_success\n+      redirect_to words_path\n+    else\n+      render 'edit'\n+    end\n+  end\n+\n+  def destroy\n+    @word = Word.find params[:id]\n+    if @word.destroy\n+      flash[:success] = I18n.t :delete_success\n+      redirect_to words_path\n+    else\n+      flash[:danger] = I18n.t :delete_fail\n+      redirect_to words_path\n+    end\n+  end\n+\n+  private\n+","path":"app/controllers/words_controller.rb","position":49,"original_position":49,"commit_id":"7508269f9c1265775f14f2e1302f035f858c0e9d","original_commit_id":"7508269f9c1265775f14f2e1302f035f858c0e9d","user":{"login":"vjnhat","id":11957665,"avatar_url":"https://avatars.githubusercontent.com/u/11957665?v=3","gravatar_id":"","url":"https://api.github.com/users/vjnhat","html_url":"https://github.com/vjnhat","followers_url":"https://api.github.com/users/vjnhat/followers","following_url":"https://api.github.com/users/vjnhat/following{/other_user}","gists_url":"https://api.github.com/users/vjnhat/gists{/gist_id}","starred_url":"https://api.github.com/users/vjnhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjnhat/subscriptions","organizations_url":"https://api.github.com/users/vjnhat/orgs","repos_url":"https://api.github.com/users/vjnhat/repos","events_url":"https://api.github.com/users/vjnhat/events{/privacy}","received_events_url":"https://api.github.com/users/vjnhat/received_events","type":"User","site_admin":false},"body":"remove this line\r\n","created_at":"2015-05-12T01:38:32Z","updated_at":"2015-05-12T01:38:32Z","html_url":"https://github.com/framgia/fels_56/pull/18#discussion_r30098677","pull_request_url":"https://api.github.com/repos/framgia/fels_56/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_56/pulls/comments/30098677"},"html":{"href":"https://github.com/framgia/fels_56/pull/18#discussion_r30098677"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_56/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_56/pulls/18","id":35116478,"html_url":"https://github.com/framgia/fels_56/pull/18","diff_url":"https://github.com/framgia/fels_56/pull/18.diff","patch_url":"https://github.com/framgia/fels_56/pull/18.patch","issue_url":"https://api.github.com/repos/framgia/fels_56/issues/18","number":18,"state":"open","locked":false,"title":"word controller","user":{"login":"NguyenTanDuc","id":12166369,"avatar_url":"https://avatars.githubusercontent.com/u/12166369?v=3","gravatar_id":"","url":"https://api.github.com/users/NguyenTanDuc","html_url":"https://github.com/NguyenTanDuc","followers_url":"https://api.github.com/users/NguyenTanDuc/followers","following_url":"https://api.github.com/users/NguyenTanDuc/following{/other_user}","gists_url":"https://api.github.com/users/NguyenTanDuc/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenTanDuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenTanDuc/subscriptions","organizations_url":"https://api.github.com/users/NguyenTanDuc/orgs","repos_url":"https://api.github.com/users/NguyenTanDuc/repos","events_url":"https://api.github.com/users/NguyenTanDuc/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenTanDuc/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-11T10:54:07Z","updated_at":"2015-05-12T01:38:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d93fa31edfa14194286359158336b809192a368e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_56/pulls/18/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_56/pulls/18/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_56/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_56/issues/18/comments","statuses_url":"https://api.github.com/repos/framgia/fels_56/statuses/7508269f9c1265775f14f2e1302f035f858c0e9d","head":{"label":"NguyenTanDuc:dynamic-wordpage2","ref":"dynamic-wordpage2","sha":"7508269f9c1265775f14f2e1302f035f858c0e9d","user":{"login":"NguyenTanDuc","id":12166369,"avatar_url":"https://avatars.githubusercontent.com/u/12166369?v=3","gravatar_id":"","url":"https://api.github.com/users/NguyenTanDuc","html_url":"https://github.com/NguyenTanDuc","followers_url":"https://api.github.com/users/NguyenTanDuc/followers","following_url":"https://api.github.com/users/NguyenTanDuc/following{/other_user}","gists_url":"https://api.github.com/users/NguyenTanDuc/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenTanDuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenTanDuc/subscriptions","organizations_url":"https://api.github.com/users/NguyenTanDuc/orgs","repos_url":"https://api.github.com/users/NguyenTanDuc/repos","events_url":"https://api.github.com/users/NguyenTanDuc/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenTanDuc/received_events","type":"User","site_admin":false},"repo":{"id":35206975,"name":"fels_56","full_name":"NguyenTanDuc/fels_56","owner":{"login":"NguyenTanDuc","id":12166369,"avatar_url":"https://avatars.githubusercontent.com/u/12166369?v=3","gravatar_id":"","url":"https://api.github.com/users/NguyenTanDuc","html_url":"https://github.com/NguyenTanDuc","followers_url":"https://api.github.com/users/NguyenTanDuc/followers","following_url":"https://api.github.com/users/NguyenTanDuc/following{/other_user}","gists_url":"https://api.github.com/users/NguyenTanDuc/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenTanDuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenTanDuc/subscriptions","organizations_url":"https://api.github.com/users/NguyenTanDuc/orgs","repos_url":"https://api.github.com/users/NguyenTanDuc/repos","events_url":"https://api.github.com/users/NguyenTanDuc/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenTanDuc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NguyenTanDuc/fels_56","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/NguyenTanDuc/fels_56","forks_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/forks","keys_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/teams","hooks_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/hooks","issue_events_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/issues/events{/number}","events_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/events","assignees_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/assignees{/user}","branches_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/branches{/branch}","tags_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/tags","blobs_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/git/refs{/sha}","trees_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/statuses/{sha}","languages_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/languages","stargazers_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/stargazers","contributors_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/contributors","subscribers_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/subscribers","subscription_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/subscription","commits_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/commits{/sha}","git_commits_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/git/commits{/sha}","comments_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/comments{/number}","issue_comment_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/issues/comments{/number}","contents_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/contents/{+path}","compare_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/merges","archive_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/downloads","issues_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/issues{/number}","pulls_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/pulls{/number}","milestones_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/milestones{/number}","notifications_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/labels{/name}","releases_url":"https://api.github.com/repos/NguyenTanDuc/fels_56/releases{/id}","created_at":"2015-05-07T08:04:09Z","updated_at":"2015-05-06T06:44:03Z","pushed_at":"2015-05-11T10:53:44Z","git_url":"git://github.com/NguyenTanDuc/fels_56.git","ssh_url":"git@github.com:NguyenTanDuc/fels_56.git","clone_url":"https://github.com/NguyenTanDuc/fels_56.git","svn_url":"https://github.com/NguyenTanDuc/fels_56","homepage":null,"size":155,"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":"5f28a1764a20fbf953f865e20671cf8c08223dcc","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":35143594,"name":"fels_56","full_name":"framgia/fels_56","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/fels_56","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_56","forks_url":"https://api.github.com/repos/framgia/fels_56/forks","keys_url":"https://api.github.com/repos/framgia/fels_56/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_56/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_56/teams","hooks_url":"https://api.github.com/repos/framgia/fels_56/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_56/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_56/events","assignees_url":"https://api.github.com/repos/framgia/fels_56/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_56/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_56/tags","blobs_url":"https://api.github.com/repos/framgia/fels_56/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_56/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_56/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_56/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_56/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_56/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_56/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_56/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_56/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_56/subscription","commits_url":"https://api.github.com/repos/framgia/fels_56/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_56/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_56/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_56/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_56/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_56/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_56/merges","archive_url":"https://api.github.com/repos/framgia/fels_56/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_56/downloads","issues_url":"https://api.github.com/repos/framgia/fels_56/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_56/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_56/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_56/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_56/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_56/releases{/id}","created_at":"2015-05-06T06:44:03Z","updated_at":"2015-05-06T06:44:03Z","pushed_at":"2015-05-11T10:54:07Z","git_url":"git://github.com/framgia/fels_56.git","ssh_url":"git@github.com:framgia/fels_56.git","clone_url":"https://github.com/framgia/fels_56.git","svn_url":"https://github.com/framgia/fels_56","homepage":null,"size":536,"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":8,"forks":2,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_56/pulls/18"},"html":{"href":"https://github.com/framgia/fels_56/pull/18"},"issue":{"href":"https://api.github.com/repos/framgia/fels_56/issues/18"},"comments":{"href":"https://api.github.com/repos/framgia/fels_56/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_56/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_56/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_56/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_56/statuses/7508269f9c1265775f14f2e1302f035f858c0e9d"}}}}