{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_64/pulls/comments/33327794","id":33327794,"diff_hunk":"@@ -18,9 +21,31 @@ def create\n     end\n   end\n \n+  def edit\n+    @user = User.find params[:id]\n+  end\n+\n+  def update\n+    @user = User.find params[:id]\n+    if @user.update_attributes user_params\n+      flash[:success] = t :update_success\n+      redirect_to @user\n+    else\n+      render \"edit\"\n+    end\n+  end\n+\n   private\n+\n   def user_params\n     params.require(:user).permit :username, :email, :password,\n-      :password_confirmation\n+      :password_confirmation, :picture\n+  end\n+\n+  def correct_user\n+    if current_user.id.to_s != params[:id]","path":"app/controllers/users_controller.rb","position":35,"original_position":35,"commit_id":"9e340f718a701dea79c898b578579a74e9457c4c","original_commit_id":"9e340f718a701dea79c898b578579a74e9457c4c","user":{"login":"khanhkhanh","id":11971311,"avatar_url":"https://avatars.githubusercontent.com/u/11971311?v=3","gravatar_id":"","url":"https://api.github.com/users/khanhkhanh","html_url":"https://github.com/khanhkhanh","followers_url":"https://api.github.com/users/khanhkhanh/followers","following_url":"https://api.github.com/users/khanhkhanh/following{/other_user}","gists_url":"https://api.github.com/users/khanhkhanh/gists{/gist_id}","starred_url":"https://api.github.com/users/khanhkhanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khanhkhanh/subscriptions","organizations_url":"https://api.github.com/users/khanhkhanh/orgs","repos_url":"https://api.github.com/users/khanhkhanh/repos","events_url":"https://api.github.com/users/khanhkhanh/events{/privacy}","received_events_url":"https://api.github.com/users/khanhkhanh/received_events","type":"User","site_admin":false},"body":".to_s is needed? If not, remove it.","created_at":"2015-06-26T04:21:09Z","updated_at":"2015-06-26T04:21:09Z","html_url":"https://github.com/framgia/fels_64/pull/10#discussion_r33327794","pull_request_url":"https://api.github.com/repos/framgia/fels_64/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_64/pulls/comments/33327794"},"html":{"href":"https://github.com/framgia/fels_64/pull/10#discussion_r33327794"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_64/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_64/pulls/10","id":38615968,"html_url":"https://github.com/framgia/fels_64/pull/10","diff_url":"https://github.com/framgia/fels_64/pull/10.diff","patch_url":"https://github.com/framgia/fels_64/pull/10.patch","issue_url":"https://api.github.com/repos/framgia/fels_64/issues/10","number":10,"state":"open","locked":false,"title":"Update profile user","user":{"login":"ducminhvu","id":12823787,"avatar_url":"https://avatars.githubusercontent.com/u/12823787?v=3","gravatar_id":"","url":"https://api.github.com/users/ducminhvu","html_url":"https://github.com/ducminhvu","followers_url":"https://api.github.com/users/ducminhvu/followers","following_url":"https://api.github.com/users/ducminhvu/following{/other_user}","gists_url":"https://api.github.com/users/ducminhvu/gists{/gist_id}","starred_url":"https://api.github.com/users/ducminhvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ducminhvu/subscriptions","organizations_url":"https://api.github.com/users/ducminhvu/orgs","repos_url":"https://api.github.com/users/ducminhvu/repos","events_url":"https://api.github.com/users/ducminhvu/events{/privacy}","received_events_url":"https://api.github.com/users/ducminhvu/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-26T04:12:30Z","updated_at":"2015-06-26T04:21:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fb669b94230de68798588d8a53c19607bf775a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_64/pulls/10/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_64/pulls/10/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_64/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_64/issues/10/comments","statuses_url":"https://api.github.com/repos/framgia/fels_64/statuses/9e340f718a701dea79c898b578579a74e9457c4c","head":{"label":"ducminhvu:update-user-profile","ref":"update-user-profile","sha":"9e340f718a701dea79c898b578579a74e9457c4c","user":{"login":"ducminhvu","id":12823787,"avatar_url":"https://avatars.githubusercontent.com/u/12823787?v=3","gravatar_id":"","url":"https://api.github.com/users/ducminhvu","html_url":"https://github.com/ducminhvu","followers_url":"https://api.github.com/users/ducminhvu/followers","following_url":"https://api.github.com/users/ducminhvu/following{/other_user}","gists_url":"https://api.github.com/users/ducminhvu/gists{/gist_id}","starred_url":"https://api.github.com/users/ducminhvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ducminhvu/subscriptions","organizations_url":"https://api.github.com/users/ducminhvu/orgs","repos_url":"https://api.github.com/users/ducminhvu/repos","events_url":"https://api.github.com/users/ducminhvu/events{/privacy}","received_events_url":"https://api.github.com/users/ducminhvu/received_events","type":"User","site_admin":false},"repo":{"id":37848315,"name":"fels_64","full_name":"ducminhvu/fels_64","owner":{"login":"ducminhvu","id":12823787,"avatar_url":"https://avatars.githubusercontent.com/u/12823787?v=3","gravatar_id":"","url":"https://api.github.com/users/ducminhvu","html_url":"https://github.com/ducminhvu","followers_url":"https://api.github.com/users/ducminhvu/followers","following_url":"https://api.github.com/users/ducminhvu/following{/other_user}","gists_url":"https://api.github.com/users/ducminhvu/gists{/gist_id}","starred_url":"https://api.github.com/users/ducminhvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ducminhvu/subscriptions","organizations_url":"https://api.github.com/users/ducminhvu/orgs","repos_url":"https://api.github.com/users/ducminhvu/repos","events_url":"https://api.github.com/users/ducminhvu/events{/privacy}","received_events_url":"https://api.github.com/users/ducminhvu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ducminhvu/fels_64","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/ducminhvu/fels_64","forks_url":"https://api.github.com/repos/ducminhvu/fels_64/forks","keys_url":"https://api.github.com/repos/ducminhvu/fels_64/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ducminhvu/fels_64/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ducminhvu/fels_64/teams","hooks_url":"https://api.github.com/repos/ducminhvu/fels_64/hooks","issue_events_url":"https://api.github.com/repos/ducminhvu/fels_64/issues/events{/number}","events_url":"https://api.github.com/repos/ducminhvu/fels_64/events","assignees_url":"https://api.github.com/repos/ducminhvu/fels_64/assignees{/user}","branches_url":"https://api.github.com/repos/ducminhvu/fels_64/branches{/branch}","tags_url":"https://api.github.com/repos/ducminhvu/fels_64/tags","blobs_url":"https://api.github.com/repos/ducminhvu/fels_64/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ducminhvu/fels_64/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ducminhvu/fels_64/git/refs{/sha}","trees_url":"https://api.github.com/repos/ducminhvu/fels_64/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ducminhvu/fels_64/statuses/{sha}","languages_url":"https://api.github.com/repos/ducminhvu/fels_64/languages","stargazers_url":"https://api.github.com/repos/ducminhvu/fels_64/stargazers","contributors_url":"https://api.github.com/repos/ducminhvu/fels_64/contributors","subscribers_url":"https://api.github.com/repos/ducminhvu/fels_64/subscribers","subscription_url":"https://api.github.com/repos/ducminhvu/fels_64/subscription","commits_url":"https://api.github.com/repos/ducminhvu/fels_64/commits{/sha}","git_commits_url":"https://api.github.com/repos/ducminhvu/fels_64/git/commits{/sha}","comments_url":"https://api.github.com/repos/ducminhvu/fels_64/comments{/number}","issue_comment_url":"https://api.github.com/repos/ducminhvu/fels_64/issues/comments{/number}","contents_url":"https://api.github.com/repos/ducminhvu/fels_64/contents/{+path}","compare_url":"https://api.github.com/repos/ducminhvu/fels_64/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ducminhvu/fels_64/merges","archive_url":"https://api.github.com/repos/ducminhvu/fels_64/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ducminhvu/fels_64/downloads","issues_url":"https://api.github.com/repos/ducminhvu/fels_64/issues{/number}","pulls_url":"https://api.github.com/repos/ducminhvu/fels_64/pulls{/number}","milestones_url":"https://api.github.com/repos/ducminhvu/fels_64/milestones{/number}","notifications_url":"https://api.github.com/repos/ducminhvu/fels_64/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ducminhvu/fels_64/labels{/name}","releases_url":"https://api.github.com/repos/ducminhvu/fels_64/releases{/id}","created_at":"2015-06-22T09:58:53Z","updated_at":"2015-06-22T02:50:52Z","pushed_at":"2015-06-26T04:11:52Z","git_url":"git://github.com/ducminhvu/fels_64.git","ssh_url":"git@github.com:ducminhvu/fels_64.git","clone_url":"https://github.com/ducminhvu/fels_64.git","svn_url":"https://github.com/ducminhvu/fels_64","homepage":null,"size":126,"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":"2da1bc2350501c73f56ab7443cfa249198940bcd","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":37835026,"name":"fels_64","full_name":"framgia/fels_64","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_64","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_64","forks_url":"https://api.github.com/repos/framgia/fels_64/forks","keys_url":"https://api.github.com/repos/framgia/fels_64/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_64/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_64/teams","hooks_url":"https://api.github.com/repos/framgia/fels_64/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_64/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_64/events","assignees_url":"https://api.github.com/repos/framgia/fels_64/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_64/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_64/tags","blobs_url":"https://api.github.com/repos/framgia/fels_64/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_64/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_64/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_64/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_64/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_64/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_64/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_64/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_64/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_64/subscription","commits_url":"https://api.github.com/repos/framgia/fels_64/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_64/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_64/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_64/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_64/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_64/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_64/merges","archive_url":"https://api.github.com/repos/framgia/fels_64/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_64/downloads","issues_url":"https://api.github.com/repos/framgia/fels_64/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_64/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_64/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_64/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_64/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_64/releases{/id}","created_at":"2015-06-22T02:50:52Z","updated_at":"2015-06-22T02:50:52Z","pushed_at":"2015-06-26T04:18:31Z","git_url":"git://github.com/framgia/fels_64.git","ssh_url":"git@github.com:framgia/fels_64.git","clone_url":"https://github.com/framgia/fels_64.git","svn_url":"https://github.com/framgia/fels_64","homepage":null,"size":408,"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":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_64/pulls/10"},"html":{"href":"https://github.com/framgia/fels_64/pull/10"},"issue":{"href":"https://api.github.com/repos/framgia/fels_64/issues/10"},"comments":{"href":"https://api.github.com/repos/framgia/fels_64/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_64/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_64/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_64/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_64/statuses/9e340f718a701dea79c898b578579a74e9457c4c"}}}}