{"action":"created","comment":{"url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/comments/39700689","id":39700689,"diff_hunk":"@@ -0,0 +1,52 @@\n+class ArticlesController < ApplicationController\n+\n+  http_basic_authenticate_with name: \"dhh\", password: \"secret\", except: [:index, :show]\n+\n+  def index\n+    @articles = Article.all\n+  end\n+\n+  def show\n+    @article = Article.find(params[:id])\n+  end\n+\n+  def new #creates a 'new' method to create new instances of articles class.\n+    @article = Article.new\n+  end\n+\n+  def edit\n+    @article = Article.find(params[:id])\n+  end\n+\n+  def create\n+    @article = Article.new(article_params)\n+\n+    if @article.save\n+      redirect_to @article\n+    else\n+      render 'new'\n+    end\n+  end\n+\n+  def update\n+    @article = Article.find(params[:id])\n+\n+    if @article.update(article_params)\n+      redirect_to @article\n+    else\n+      render 'edit'\n+    end\n+  end\n+\n+  def destroy\n+    @article = Article.find(params[:id]) #locates the article by it's parameters\n+    @article.destroy #destroys the instance of article class from the database\n+\n+    redirect_to articles_path #redirects back to articles path\n+  end\n+\n+  private\n+    def article_params\n+      params.require(:article).permit(:title, :text)\n+    end","path":"MikeCassaro-mcc33/hw_11/blog/app/controllers/articles_controller.rb","position":51,"original_position":51,"commit_id":"f89cf2eec06afcf6684483fc3f99a682d01acaed","original_commit_id":"f89cf2eec06afcf6684483fc3f99a682d01acaed","user":{"login":"chylaudes","id":10103582,"avatar_url":"https://avatars.githubusercontent.com/u/10103582?v=3","gravatar_id":"","url":"https://api.github.com/users/chylaudes","html_url":"https://github.com/chylaudes","followers_url":"https://api.github.com/users/chylaudes/followers","following_url":"https://api.github.com/users/chylaudes/following{/other_user}","gists_url":"https://api.github.com/users/chylaudes/gists{/gist_id}","starred_url":"https://api.github.com/users/chylaudes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chylaudes/subscriptions","organizations_url":"https://api.github.com/users/chylaudes/orgs","repos_url":"https://api.github.com/users/chylaudes/repos","events_url":"https://api.github.com/users/chylaudes/events{/privacy}","received_events_url":"https://api.github.com/users/chylaudes/received_events","type":"User","site_admin":false},"body":"you can define the `set_article` method here\r\n```\r\ndef set_article \r\n @article = Article.find(params[:id])\r\nend\r\n```","created_at":"2015-09-17T00:17:56Z","updated_at":"2015-09-17T00:17:56Z","html_url":"https://github.com/ga-students/bewd_sf_10_homework/pull/210#discussion_r39700689","pull_request_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/210","_links":{"self":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/comments/39700689"},"html":{"href":"https://github.com/ga-students/bewd_sf_10_homework/pull/210#discussion_r39700689"},"pull_request":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/210"}}},"pull_request":{"url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/210","id":44986999,"html_url":"https://github.com/ga-students/bewd_sf_10_homework/pull/210","diff_url":"https://github.com/ga-students/bewd_sf_10_homework/pull/210.diff","patch_url":"https://github.com/ga-students/bewd_sf_10_homework/pull/210.patch","issue_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/210","number":210,"state":"open","locked":false,"title":"Blog HW","user":{"login":"mcc33","id":10373565,"avatar_url":"https://avatars.githubusercontent.com/u/10373565?v=3","gravatar_id":"","url":"https://api.github.com/users/mcc33","html_url":"https://github.com/mcc33","followers_url":"https://api.github.com/users/mcc33/followers","following_url":"https://api.github.com/users/mcc33/following{/other_user}","gists_url":"https://api.github.com/users/mcc33/gists{/gist_id}","starred_url":"https://api.github.com/users/mcc33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcc33/subscriptions","organizations_url":"https://api.github.com/users/mcc33/orgs","repos_url":"https://api.github.com/users/mcc33/repos","events_url":"https://api.github.com/users/mcc33/events{/privacy}","received_events_url":"https://api.github.com/users/mcc33/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-14T22:05:33Z","updated_at":"2015-09-17T00:17:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"589587b553614f10c8822263c699b28e7e94338a","assignee":{"login":"chylaudes","id":10103582,"avatar_url":"https://avatars.githubusercontent.com/u/10103582?v=3","gravatar_id":"","url":"https://api.github.com/users/chylaudes","html_url":"https://github.com/chylaudes","followers_url":"https://api.github.com/users/chylaudes/followers","following_url":"https://api.github.com/users/chylaudes/following{/other_user}","gists_url":"https://api.github.com/users/chylaudes/gists{/gist_id}","starred_url":"https://api.github.com/users/chylaudes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chylaudes/subscriptions","organizations_url":"https://api.github.com/users/chylaudes/orgs","repos_url":"https://api.github.com/users/chylaudes/repos","events_url":"https://api.github.com/users/chylaudes/events{/privacy}","received_events_url":"https://api.github.com/users/chylaudes/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/210/commits","review_comments_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/210/comments","review_comment_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/210/comments","statuses_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/statuses/f89cf2eec06afcf6684483fc3f99a682d01acaed","head":{"label":"mcc33:hw_11","ref":"hw_11","sha":"f89cf2eec06afcf6684483fc3f99a682d01acaed","user":{"login":"mcc33","id":10373565,"avatar_url":"https://avatars.githubusercontent.com/u/10373565?v=3","gravatar_id":"","url":"https://api.github.com/users/mcc33","html_url":"https://github.com/mcc33","followers_url":"https://api.github.com/users/mcc33/followers","following_url":"https://api.github.com/users/mcc33/following{/other_user}","gists_url":"https://api.github.com/users/mcc33/gists{/gist_id}","starred_url":"https://api.github.com/users/mcc33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcc33/subscriptions","organizations_url":"https://api.github.com/users/mcc33/orgs","repos_url":"https://api.github.com/users/mcc33/repos","events_url":"https://api.github.com/users/mcc33/events{/privacy}","received_events_url":"https://api.github.com/users/mcc33/received_events","type":"User","site_admin":false},"repo":{"id":39925749,"name":"bewd_sf_10_homework","full_name":"mcc33/bewd_sf_10_homework","owner":{"login":"mcc33","id":10373565,"avatar_url":"https://avatars.githubusercontent.com/u/10373565?v=3","gravatar_id":"","url":"https://api.github.com/users/mcc33","html_url":"https://github.com/mcc33","followers_url":"https://api.github.com/users/mcc33/followers","following_url":"https://api.github.com/users/mcc33/following{/other_user}","gists_url":"https://api.github.com/users/mcc33/gists{/gist_id}","starred_url":"https://api.github.com/users/mcc33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcc33/subscriptions","organizations_url":"https://api.github.com/users/mcc33/orgs","repos_url":"https://api.github.com/users/mcc33/repos","events_url":"https://api.github.com/users/mcc33/events{/privacy}","received_events_url":"https://api.github.com/users/mcc33/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mcc33/bewd_sf_10_homework","description":"BEWD 10 Cohort Homework","fork":true,"url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework","forks_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/forks","keys_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/teams","hooks_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/hooks","issue_events_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/issues/events{/number}","events_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/events","assignees_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/assignees{/user}","branches_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/branches{/branch}","tags_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/tags","blobs_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/statuses/{sha}","languages_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/languages","stargazers_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/stargazers","contributors_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/contributors","subscribers_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/subscribers","subscription_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/subscription","commits_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/contents/{+path}","compare_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/merges","archive_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/downloads","issues_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/issues{/number}","pulls_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/pulls{/number}","milestones_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/milestones{/number}","notifications_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/labels{/name}","releases_url":"https://api.github.com/repos/mcc33/bewd_sf_10_homework/releases{/id}","created_at":"2015-07-30T01:53:48Z","updated_at":"2015-07-30T02:45:41Z","pushed_at":"2015-09-14T22:05:05Z","git_url":"git://github.com/mcc33/bewd_sf_10_homework.git","ssh_url":"git@github.com:mcc33/bewd_sf_10_homework.git","clone_url":"https://github.com/mcc33/bewd_sf_10_homework.git","svn_url":"https://github.com/mcc33/bewd_sf_10_homework","homepage":null,"size":129,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"ga-students:master","ref":"master","sha":"8d214259dd20952ad6728c9954a817cd14a4588b","user":{"login":"ga-students","id":5048067,"avatar_url":"https://avatars.githubusercontent.com/u/5048067?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-students","html_url":"https://github.com/ga-students","followers_url":"https://api.github.com/users/ga-students/followers","following_url":"https://api.github.com/users/ga-students/following{/other_user}","gists_url":"https://api.github.com/users/ga-students/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-students/subscriptions","organizations_url":"https://api.github.com/users/ga-students/orgs","repos_url":"https://api.github.com/users/ga-students/repos","events_url":"https://api.github.com/users/ga-students/events{/privacy}","received_events_url":"https://api.github.com/users/ga-students/received_events","type":"Organization","site_admin":false},"repo":{"id":39805458,"name":"bewd_sf_10_homework","full_name":"ga-students/bewd_sf_10_homework","owner":{"login":"ga-students","id":5048067,"avatar_url":"https://avatars.githubusercontent.com/u/5048067?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-students","html_url":"https://github.com/ga-students","followers_url":"https://api.github.com/users/ga-students/followers","following_url":"https://api.github.com/users/ga-students/following{/other_user}","gists_url":"https://api.github.com/users/ga-students/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-students/subscriptions","organizations_url":"https://api.github.com/users/ga-students/orgs","repos_url":"https://api.github.com/users/ga-students/repos","events_url":"https://api.github.com/users/ga-students/events{/privacy}","received_events_url":"https://api.github.com/users/ga-students/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga-students/bewd_sf_10_homework","description":"BEWD 10 Cohort Homework","fork":false,"url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework","forks_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/forks","keys_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/teams","hooks_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/hooks","issue_events_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/events{/number}","events_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/events","assignees_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/assignees{/user}","branches_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/branches{/branch}","tags_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/tags","blobs_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/statuses/{sha}","languages_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/languages","stargazers_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/stargazers","contributors_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/contributors","subscribers_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/subscribers","subscription_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/subscription","commits_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/contents/{+path}","compare_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/merges","archive_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/downloads","issues_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues{/number}","pulls_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls{/number}","milestones_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/milestones{/number}","notifications_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/labels{/name}","releases_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/releases{/id}","created_at":"2015-07-28T00:57:38Z","updated_at":"2015-08-07T03:46:14Z","pushed_at":"2015-09-17T00:03:33Z","git_url":"git://github.com/ga-students/bewd_sf_10_homework.git","ssh_url":"git@github.com:ga-students/bewd_sf_10_homework.git","clone_url":"https://github.com/ga-students/bewd_sf_10_homework.git","svn_url":"https://github.com/ga-students/bewd_sf_10_homework","homepage":null,"size":7188,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":12,"forks":34,"open_issues":12,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/210"},"html":{"href":"https://github.com/ga-students/bewd_sf_10_homework/pull/210"},"issue":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/210"},"comments":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/210/comments"},"review_comments":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/210/comments"},"review_comment":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/210/commits"},"statuses":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/statuses/f89cf2eec06afcf6684483fc3f99a682d01acaed"}}}}