{"action":"created","comment":{"url":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/comments/34601718","id":34601718,"diff_hunk":"@@ -0,0 +1,68 @@\n+class ContentsController < ApplicationController\n+  before_action :authenticate_user!\n+#   do\n+#   verify_user_owns_content(params[:id])\n+# end\n+  def index\n+    @contents = Content.all\n+  end\n+\n+  def show\n+    @content = Content.find(params[:id])\n+  end\n+\n+  def new\n+    @content = Content.new\n+  end\n+\n+  def create\n+    @content = Content.new(content_params)\n+    @content.user = current_user\n+\n+      if @content.save\n+        flash[:notice] = 'Picture added'\n+        redirect_to '/contents'\n+      else\n+        flash[:error] = 'Picture NOT added'\n+        render :new\n+      end\n+  end\n+\n+  def edit\n+    @content = Content.find(params[:id])\n+  end\n+\n+  def update\n+    @content = Content.find(params[:id])\n+      if @content.update_attributes!(content_params)\n+        flash[:notice] = 'You edited your content'\n+        redirect_to '/contents'\n+      else\n+        flash[:error] = 'Something went wrong!'\n+        render :edit\n+      end\n+  end\n+\n+  def destroy\n+    if @content = Content.find(params[:id])\n+    @content.destroy\n+    flash[:notice] = \"You deleted the content\"\n+    redirect_to '/contents'\n+    else\n+      flash[:error]\n+    end\n+  end\n+\n+  protected\n+  def content_params\n+    params.require(:content).permit(:picture, :body, :user_id)\n+  end\n+\n+  # def verify_user_owns_content(id)\n+  # content = Content.find(id)\n+  # user = current_user\n+  #\n+  # redirect_to users_path unless user.owns?(content) || user.admin?\n+# end","path":"app/controllers/contents_controller.rb","position":66,"original_position":66,"commit_id":"5012af03382d877160f51d62800d04330770ffcf","original_commit_id":"5012af03382d877160f51d62800d04330770ffcf","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Incorrect indentation detected (column 0 instead of 2).","created_at":"2015-07-14T18:26:14Z","updated_at":"2015-07-14T18:26:14Z","html_url":"https://github.com/lashminov/baby_in_bloom/pull/3#discussion_r34601718","pull_request_url":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/comments/34601718"},"html":{"href":"https://github.com/lashminov/baby_in_bloom/pull/3#discussion_r34601718"},"pull_request":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/3","id":39946385,"html_url":"https://github.com/lashminov/baby_in_bloom/pull/3","diff_url":"https://github.com/lashminov/baby_in_bloom/pull/3.diff","patch_url":"https://github.com/lashminov/baby_in_bloom/pull/3.patch","issue_url":"https://api.github.com/repos/lashminov/baby_in_bloom/issues/3","number":3,"state":"open","locked":false,"title":"RFR: Add content","user":{"login":"lashminov","id":11586139,"avatar_url":"https://avatars.githubusercontent.com/u/11586139?v=3","gravatar_id":"","url":"https://api.github.com/users/lashminov","html_url":"https://github.com/lashminov","followers_url":"https://api.github.com/users/lashminov/followers","following_url":"https://api.github.com/users/lashminov/following{/other_user}","gists_url":"https://api.github.com/users/lashminov/gists{/gist_id}","starred_url":"https://api.github.com/users/lashminov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lashminov/subscriptions","organizations_url":"https://api.github.com/users/lashminov/orgs","repos_url":"https://api.github.com/users/lashminov/repos","events_url":"https://api.github.com/users/lashminov/events{/privacy}","received_events_url":"https://api.github.com/users/lashminov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-14T18:25:59Z","updated_at":"2015-07-14T18:26:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"388ad067d58acf3fef643de8f3ba9c6a75c153c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/3/commits","review_comments_url":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/3/comments","review_comment_url":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lashminov/baby_in_bloom/issues/3/comments","statuses_url":"https://api.github.com/repos/lashminov/baby_in_bloom/statuses/5012af03382d877160f51d62800d04330770ffcf","head":{"label":"lashminov:add_content","ref":"add_content","sha":"5012af03382d877160f51d62800d04330770ffcf","user":{"login":"lashminov","id":11586139,"avatar_url":"https://avatars.githubusercontent.com/u/11586139?v=3","gravatar_id":"","url":"https://api.github.com/users/lashminov","html_url":"https://github.com/lashminov","followers_url":"https://api.github.com/users/lashminov/followers","following_url":"https://api.github.com/users/lashminov/following{/other_user}","gists_url":"https://api.github.com/users/lashminov/gists{/gist_id}","starred_url":"https://api.github.com/users/lashminov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lashminov/subscriptions","organizations_url":"https://api.github.com/users/lashminov/orgs","repos_url":"https://api.github.com/users/lashminov/repos","events_url":"https://api.github.com/users/lashminov/events{/privacy}","received_events_url":"https://api.github.com/users/lashminov/received_events","type":"User","site_admin":false},"repo":{"id":38887969,"name":"baby_in_bloom","full_name":"lashminov/baby_in_bloom","owner":{"login":"lashminov","id":11586139,"avatar_url":"https://avatars.githubusercontent.com/u/11586139?v=3","gravatar_id":"","url":"https://api.github.com/users/lashminov","html_url":"https://github.com/lashminov","followers_url":"https://api.github.com/users/lashminov/followers","following_url":"https://api.github.com/users/lashminov/following{/other_user}","gists_url":"https://api.github.com/users/lashminov/gists{/gist_id}","starred_url":"https://api.github.com/users/lashminov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lashminov/subscriptions","organizations_url":"https://api.github.com/users/lashminov/orgs","repos_url":"https://api.github.com/users/lashminov/repos","events_url":"https://api.github.com/users/lashminov/events{/privacy}","received_events_url":"https://api.github.com/users/lashminov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lashminov/baby_in_bloom","description":"A pictorial journey through your baby's first year!","fork":false,"url":"https://api.github.com/repos/lashminov/baby_in_bloom","forks_url":"https://api.github.com/repos/lashminov/baby_in_bloom/forks","keys_url":"https://api.github.com/repos/lashminov/baby_in_bloom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lashminov/baby_in_bloom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lashminov/baby_in_bloom/teams","hooks_url":"https://api.github.com/repos/lashminov/baby_in_bloom/hooks","issue_events_url":"https://api.github.com/repos/lashminov/baby_in_bloom/issues/events{/number}","events_url":"https://api.github.com/repos/lashminov/baby_in_bloom/events","assignees_url":"https://api.github.com/repos/lashminov/baby_in_bloom/assignees{/user}","branches_url":"https://api.github.com/repos/lashminov/baby_in_bloom/branches{/branch}","tags_url":"https://api.github.com/repos/lashminov/baby_in_bloom/tags","blobs_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/refs{/sha}","trees_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lashminov/baby_in_bloom/statuses/{sha}","languages_url":"https://api.github.com/repos/lashminov/baby_in_bloom/languages","stargazers_url":"https://api.github.com/repos/lashminov/baby_in_bloom/stargazers","contributors_url":"https://api.github.com/repos/lashminov/baby_in_bloom/contributors","subscribers_url":"https://api.github.com/repos/lashminov/baby_in_bloom/subscribers","subscription_url":"https://api.github.com/repos/lashminov/baby_in_bloom/subscription","commits_url":"https://api.github.com/repos/lashminov/baby_in_bloom/commits{/sha}","git_commits_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/commits{/sha}","comments_url":"https://api.github.com/repos/lashminov/baby_in_bloom/comments{/number}","issue_comment_url":"https://api.github.com/repos/lashminov/baby_in_bloom/issues/comments{/number}","contents_url":"https://api.github.com/repos/lashminov/baby_in_bloom/contents/{+path}","compare_url":"https://api.github.com/repos/lashminov/baby_in_bloom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lashminov/baby_in_bloom/merges","archive_url":"https://api.github.com/repos/lashminov/baby_in_bloom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lashminov/baby_in_bloom/downloads","issues_url":"https://api.github.com/repos/lashminov/baby_in_bloom/issues{/number}","pulls_url":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls{/number}","milestones_url":"https://api.github.com/repos/lashminov/baby_in_bloom/milestones{/number}","notifications_url":"https://api.github.com/repos/lashminov/baby_in_bloom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lashminov/baby_in_bloom/labels{/name}","releases_url":"https://api.github.com/repos/lashminov/baby_in_bloom/releases{/id}","created_at":"2015-07-10T15:35:19Z","updated_at":"2015-07-13T19:31:51Z","pushed_at":"2015-07-14T18:25:59Z","git_url":"git://github.com/lashminov/baby_in_bloom.git","ssh_url":"git@github.com:lashminov/baby_in_bloom.git","clone_url":"https://github.com/lashminov/baby_in_bloom.git","svn_url":"https://github.com/lashminov/baby_in_bloom","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lashminov:master","ref":"master","sha":"e16c53c96e8ab2c8db5866a42102e17b53ce447e","user":{"login":"lashminov","id":11586139,"avatar_url":"https://avatars.githubusercontent.com/u/11586139?v=3","gravatar_id":"","url":"https://api.github.com/users/lashminov","html_url":"https://github.com/lashminov","followers_url":"https://api.github.com/users/lashminov/followers","following_url":"https://api.github.com/users/lashminov/following{/other_user}","gists_url":"https://api.github.com/users/lashminov/gists{/gist_id}","starred_url":"https://api.github.com/users/lashminov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lashminov/subscriptions","organizations_url":"https://api.github.com/users/lashminov/orgs","repos_url":"https://api.github.com/users/lashminov/repos","events_url":"https://api.github.com/users/lashminov/events{/privacy}","received_events_url":"https://api.github.com/users/lashminov/received_events","type":"User","site_admin":false},"repo":{"id":38887969,"name":"baby_in_bloom","full_name":"lashminov/baby_in_bloom","owner":{"login":"lashminov","id":11586139,"avatar_url":"https://avatars.githubusercontent.com/u/11586139?v=3","gravatar_id":"","url":"https://api.github.com/users/lashminov","html_url":"https://github.com/lashminov","followers_url":"https://api.github.com/users/lashminov/followers","following_url":"https://api.github.com/users/lashminov/following{/other_user}","gists_url":"https://api.github.com/users/lashminov/gists{/gist_id}","starred_url":"https://api.github.com/users/lashminov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lashminov/subscriptions","organizations_url":"https://api.github.com/users/lashminov/orgs","repos_url":"https://api.github.com/users/lashminov/repos","events_url":"https://api.github.com/users/lashminov/events{/privacy}","received_events_url":"https://api.github.com/users/lashminov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lashminov/baby_in_bloom","description":"A pictorial journey through your baby's first year!","fork":false,"url":"https://api.github.com/repos/lashminov/baby_in_bloom","forks_url":"https://api.github.com/repos/lashminov/baby_in_bloom/forks","keys_url":"https://api.github.com/repos/lashminov/baby_in_bloom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lashminov/baby_in_bloom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lashminov/baby_in_bloom/teams","hooks_url":"https://api.github.com/repos/lashminov/baby_in_bloom/hooks","issue_events_url":"https://api.github.com/repos/lashminov/baby_in_bloom/issues/events{/number}","events_url":"https://api.github.com/repos/lashminov/baby_in_bloom/events","assignees_url":"https://api.github.com/repos/lashminov/baby_in_bloom/assignees{/user}","branches_url":"https://api.github.com/repos/lashminov/baby_in_bloom/branches{/branch}","tags_url":"https://api.github.com/repos/lashminov/baby_in_bloom/tags","blobs_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/refs{/sha}","trees_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lashminov/baby_in_bloom/statuses/{sha}","languages_url":"https://api.github.com/repos/lashminov/baby_in_bloom/languages","stargazers_url":"https://api.github.com/repos/lashminov/baby_in_bloom/stargazers","contributors_url":"https://api.github.com/repos/lashminov/baby_in_bloom/contributors","subscribers_url":"https://api.github.com/repos/lashminov/baby_in_bloom/subscribers","subscription_url":"https://api.github.com/repos/lashminov/baby_in_bloom/subscription","commits_url":"https://api.github.com/repos/lashminov/baby_in_bloom/commits{/sha}","git_commits_url":"https://api.github.com/repos/lashminov/baby_in_bloom/git/commits{/sha}","comments_url":"https://api.github.com/repos/lashminov/baby_in_bloom/comments{/number}","issue_comment_url":"https://api.github.com/repos/lashminov/baby_in_bloom/issues/comments{/number}","contents_url":"https://api.github.com/repos/lashminov/baby_in_bloom/contents/{+path}","compare_url":"https://api.github.com/repos/lashminov/baby_in_bloom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lashminov/baby_in_bloom/merges","archive_url":"https://api.github.com/repos/lashminov/baby_in_bloom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lashminov/baby_in_bloom/downloads","issues_url":"https://api.github.com/repos/lashminov/baby_in_bloom/issues{/number}","pulls_url":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls{/number}","milestones_url":"https://api.github.com/repos/lashminov/baby_in_bloom/milestones{/number}","notifications_url":"https://api.github.com/repos/lashminov/baby_in_bloom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lashminov/baby_in_bloom/labels{/name}","releases_url":"https://api.github.com/repos/lashminov/baby_in_bloom/releases{/id}","created_at":"2015-07-10T15:35:19Z","updated_at":"2015-07-13T19:31:51Z","pushed_at":"2015-07-14T18:25:59Z","git_url":"git://github.com/lashminov/baby_in_bloom.git","ssh_url":"git@github.com:lashminov/baby_in_bloom.git","clone_url":"https://github.com/lashminov/baby_in_bloom.git","svn_url":"https://github.com/lashminov/baby_in_bloom","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/3"},"html":{"href":"https://github.com/lashminov/baby_in_bloom/pull/3"},"issue":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/issues/3"},"comments":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/lashminov/baby_in_bloom/statuses/5012af03382d877160f51d62800d04330770ffcf"}}}}