{"action":"created","comment":{"url":"https://api.github.com/repos/itiswicked/best_reads/pulls/comments/49002947","id":49002947,"diff_hunk":"@@ -0,0 +1,51 @@\n+class BooksController < ApplicationController\n+  def index\n+    @books = Book.all\n+  end\n+\n+  def show\n+    @book = Book.find(params[:id])\n+    # @reviews = @book.reviews\n+  end\n+\n+  def new\n+    @book = Book.new\n+    @author = Author.new\n+    @genres_collection = genres_collection\n+  end\n+\n+  def create\n+    @book = Book.new(book_params)\n+    @genres_collection = genres_collection\n+\n+    @author = Author.find_or_create_by(name: author_params[:author])\n+    @book.author = @author\n+\n+    if @book.save\n+      flash[:notice] = \"Book added successfully\"\n+      redirect_to books_path, alert: \"Book Added Successfully\"\n+    else\n+      flash[:notice] = \"Book not created\"\n+      render :new\n+    end\n+  end\n+\n+  private\n+\n+  def book_params\n+    params.require(:book).permit(:title,\n+                                 :description,\n+                                 :year,","path":"app/controllers/books_controller.rb","position":38,"original_position":38,"commit_id":"6add3508982dcb53eaedf8584a13435ca1161664","original_commit_id":"6add3508982dcb53eaedf8584a13435ca1161664","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":"Align the parameters of a method call if they span more than one line.","created_at":"2016-01-06T20:05:41Z","updated_at":"2016-01-06T20:05:41Z","html_url":"https://github.com/itiswicked/best_reads/pull/5#discussion_r49002947","pull_request_url":"https://api.github.com/repos/itiswicked/best_reads/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/itiswicked/best_reads/pulls/comments/49002947"},"html":{"href":"https://github.com/itiswicked/best_reads/pull/5#discussion_r49002947"},"pull_request":{"href":"https://api.github.com/repos/itiswicked/best_reads/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/itiswicked/best_reads/pulls/5","id":55253826,"html_url":"https://github.com/itiswicked/best_reads/pull/5","diff_url":"https://github.com/itiswicked/best_reads/pull/5.diff","patch_url":"https://github.com/itiswicked/best_reads/pull/5.patch","issue_url":"https://api.github.com/repos/itiswicked/best_reads/issues/5","number":5,"state":"open","locked":false,"title":"Create books","user":{"login":"JosephWinfield","id":13936766,"avatar_url":"https://avatars.githubusercontent.com/u/13936766?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephWinfield","html_url":"https://github.com/JosephWinfield","followers_url":"https://api.github.com/users/JosephWinfield/followers","following_url":"https://api.github.com/users/JosephWinfield/following{/other_user}","gists_url":"https://api.github.com/users/JosephWinfield/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephWinfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephWinfield/subscriptions","organizations_url":"https://api.github.com/users/JosephWinfield/orgs","repos_url":"https://api.github.com/users/JosephWinfield/repos","events_url":"https://api.github.com/users/JosephWinfield/events{/privacy}","received_events_url":"https://api.github.com/users/JosephWinfield/received_events","type":"User","site_admin":false},"body":"Built the books model along with authors and genres normalization. Built feature tests for books model as  well as `index`, `show`, and `new` pages","created_at":"2016-01-06T19:34:17Z","updated_at":"2016-01-06T20:05:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de26d049fa3179466e1d7095da3a1b3e630268f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/itiswicked/best_reads/pulls/5/commits","review_comments_url":"https://api.github.com/repos/itiswicked/best_reads/pulls/5/comments","review_comment_url":"https://api.github.com/repos/itiswicked/best_reads/pulls/comments{/number}","comments_url":"https://api.github.com/repos/itiswicked/best_reads/issues/5/comments","statuses_url":"https://api.github.com/repos/itiswicked/best_reads/statuses/6add3508982dcb53eaedf8584a13435ca1161664","head":{"label":"itiswicked:create_books","ref":"create_books","sha":"6add3508982dcb53eaedf8584a13435ca1161664","user":{"login":"itiswicked","id":8851553,"avatar_url":"https://avatars.githubusercontent.com/u/8851553?v=3","gravatar_id":"","url":"https://api.github.com/users/itiswicked","html_url":"https://github.com/itiswicked","followers_url":"https://api.github.com/users/itiswicked/followers","following_url":"https://api.github.com/users/itiswicked/following{/other_user}","gists_url":"https://api.github.com/users/itiswicked/gists{/gist_id}","starred_url":"https://api.github.com/users/itiswicked/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itiswicked/subscriptions","organizations_url":"https://api.github.com/users/itiswicked/orgs","repos_url":"https://api.github.com/users/itiswicked/repos","events_url":"https://api.github.com/users/itiswicked/events{/privacy}","received_events_url":"https://api.github.com/users/itiswicked/received_events","type":"User","site_admin":false},"repo":{"id":49073685,"name":"best_reads","full_name":"itiswicked/best_reads","owner":{"login":"itiswicked","id":8851553,"avatar_url":"https://avatars.githubusercontent.com/u/8851553?v=3","gravatar_id":"","url":"https://api.github.com/users/itiswicked","html_url":"https://github.com/itiswicked","followers_url":"https://api.github.com/users/itiswicked/followers","following_url":"https://api.github.com/users/itiswicked/following{/other_user}","gists_url":"https://api.github.com/users/itiswicked/gists{/gist_id}","starred_url":"https://api.github.com/users/itiswicked/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itiswicked/subscriptions","organizations_url":"https://api.github.com/users/itiswicked/orgs","repos_url":"https://api.github.com/users/itiswicked/repos","events_url":"https://api.github.com/users/itiswicked/events{/privacy}","received_events_url":"https://api.github.com/users/itiswicked/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/itiswicked/best_reads","description":null,"fork":false,"url":"https://api.github.com/repos/itiswicked/best_reads","forks_url":"https://api.github.com/repos/itiswicked/best_reads/forks","keys_url":"https://api.github.com/repos/itiswicked/best_reads/keys{/key_id}","collaborators_url":"https://api.github.com/repos/itiswicked/best_reads/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/itiswicked/best_reads/teams","hooks_url":"https://api.github.com/repos/itiswicked/best_reads/hooks","issue_events_url":"https://api.github.com/repos/itiswicked/best_reads/issues/events{/number}","events_url":"https://api.github.com/repos/itiswicked/best_reads/events","assignees_url":"https://api.github.com/repos/itiswicked/best_reads/assignees{/user}","branches_url":"https://api.github.com/repos/itiswicked/best_reads/branches{/branch}","tags_url":"https://api.github.com/repos/itiswicked/best_reads/tags","blobs_url":"https://api.github.com/repos/itiswicked/best_reads/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/itiswicked/best_reads/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/itiswicked/best_reads/git/refs{/sha}","trees_url":"https://api.github.com/repos/itiswicked/best_reads/git/trees{/sha}","statuses_url":"https://api.github.com/repos/itiswicked/best_reads/statuses/{sha}","languages_url":"https://api.github.com/repos/itiswicked/best_reads/languages","stargazers_url":"https://api.github.com/repos/itiswicked/best_reads/stargazers","contributors_url":"https://api.github.com/repos/itiswicked/best_reads/contributors","subscribers_url":"https://api.github.com/repos/itiswicked/best_reads/subscribers","subscription_url":"https://api.github.com/repos/itiswicked/best_reads/subscription","commits_url":"https://api.github.com/repos/itiswicked/best_reads/commits{/sha}","git_commits_url":"https://api.github.com/repos/itiswicked/best_reads/git/commits{/sha}","comments_url":"https://api.github.com/repos/itiswicked/best_reads/comments{/number}","issue_comment_url":"https://api.github.com/repos/itiswicked/best_reads/issues/comments{/number}","contents_url":"https://api.github.com/repos/itiswicked/best_reads/contents/{+path}","compare_url":"https://api.github.com/repos/itiswicked/best_reads/compare/{base}...{head}","merges_url":"https://api.github.com/repos/itiswicked/best_reads/merges","archive_url":"https://api.github.com/repos/itiswicked/best_reads/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/itiswicked/best_reads/downloads","issues_url":"https://api.github.com/repos/itiswicked/best_reads/issues{/number}","pulls_url":"https://api.github.com/repos/itiswicked/best_reads/pulls{/number}","milestones_url":"https://api.github.com/repos/itiswicked/best_reads/milestones{/number}","notifications_url":"https://api.github.com/repos/itiswicked/best_reads/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/itiswicked/best_reads/labels{/name}","releases_url":"https://api.github.com/repos/itiswicked/best_reads/releases{/id}","created_at":"2016-01-05T15:16:49Z","updated_at":"2016-01-05T19:14:31Z","pushed_at":"2016-01-06T20:05:36Z","git_url":"git://github.com/itiswicked/best_reads.git","ssh_url":"git@github.com:itiswicked/best_reads.git","clone_url":"https://github.com/itiswicked/best_reads.git","svn_url":"https://github.com/itiswicked/best_reads","homepage":null,"size":71,"stargazers_count":2,"watchers_count":2,"language":"Ruby","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":2,"default_branch":"master"}},"base":{"label":"itiswicked:master","ref":"master","sha":"b5e442d48e8c258208849199a99f99678bfa7e14","user":{"login":"itiswicked","id":8851553,"avatar_url":"https://avatars.githubusercontent.com/u/8851553?v=3","gravatar_id":"","url":"https://api.github.com/users/itiswicked","html_url":"https://github.com/itiswicked","followers_url":"https://api.github.com/users/itiswicked/followers","following_url":"https://api.github.com/users/itiswicked/following{/other_user}","gists_url":"https://api.github.com/users/itiswicked/gists{/gist_id}","starred_url":"https://api.github.com/users/itiswicked/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itiswicked/subscriptions","organizations_url":"https://api.github.com/users/itiswicked/orgs","repos_url":"https://api.github.com/users/itiswicked/repos","events_url":"https://api.github.com/users/itiswicked/events{/privacy}","received_events_url":"https://api.github.com/users/itiswicked/received_events","type":"User","site_admin":false},"repo":{"id":49073685,"name":"best_reads","full_name":"itiswicked/best_reads","owner":{"login":"itiswicked","id":8851553,"avatar_url":"https://avatars.githubusercontent.com/u/8851553?v=3","gravatar_id":"","url":"https://api.github.com/users/itiswicked","html_url":"https://github.com/itiswicked","followers_url":"https://api.github.com/users/itiswicked/followers","following_url":"https://api.github.com/users/itiswicked/following{/other_user}","gists_url":"https://api.github.com/users/itiswicked/gists{/gist_id}","starred_url":"https://api.github.com/users/itiswicked/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itiswicked/subscriptions","organizations_url":"https://api.github.com/users/itiswicked/orgs","repos_url":"https://api.github.com/users/itiswicked/repos","events_url":"https://api.github.com/users/itiswicked/events{/privacy}","received_events_url":"https://api.github.com/users/itiswicked/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/itiswicked/best_reads","description":null,"fork":false,"url":"https://api.github.com/repos/itiswicked/best_reads","forks_url":"https://api.github.com/repos/itiswicked/best_reads/forks","keys_url":"https://api.github.com/repos/itiswicked/best_reads/keys{/key_id}","collaborators_url":"https://api.github.com/repos/itiswicked/best_reads/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/itiswicked/best_reads/teams","hooks_url":"https://api.github.com/repos/itiswicked/best_reads/hooks","issue_events_url":"https://api.github.com/repos/itiswicked/best_reads/issues/events{/number}","events_url":"https://api.github.com/repos/itiswicked/best_reads/events","assignees_url":"https://api.github.com/repos/itiswicked/best_reads/assignees{/user}","branches_url":"https://api.github.com/repos/itiswicked/best_reads/branches{/branch}","tags_url":"https://api.github.com/repos/itiswicked/best_reads/tags","blobs_url":"https://api.github.com/repos/itiswicked/best_reads/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/itiswicked/best_reads/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/itiswicked/best_reads/git/refs{/sha}","trees_url":"https://api.github.com/repos/itiswicked/best_reads/git/trees{/sha}","statuses_url":"https://api.github.com/repos/itiswicked/best_reads/statuses/{sha}","languages_url":"https://api.github.com/repos/itiswicked/best_reads/languages","stargazers_url":"https://api.github.com/repos/itiswicked/best_reads/stargazers","contributors_url":"https://api.github.com/repos/itiswicked/best_reads/contributors","subscribers_url":"https://api.github.com/repos/itiswicked/best_reads/subscribers","subscription_url":"https://api.github.com/repos/itiswicked/best_reads/subscription","commits_url":"https://api.github.com/repos/itiswicked/best_reads/commits{/sha}","git_commits_url":"https://api.github.com/repos/itiswicked/best_reads/git/commits{/sha}","comments_url":"https://api.github.com/repos/itiswicked/best_reads/comments{/number}","issue_comment_url":"https://api.github.com/repos/itiswicked/best_reads/issues/comments{/number}","contents_url":"https://api.github.com/repos/itiswicked/best_reads/contents/{+path}","compare_url":"https://api.github.com/repos/itiswicked/best_reads/compare/{base}...{head}","merges_url":"https://api.github.com/repos/itiswicked/best_reads/merges","archive_url":"https://api.github.com/repos/itiswicked/best_reads/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/itiswicked/best_reads/downloads","issues_url":"https://api.github.com/repos/itiswicked/best_reads/issues{/number}","pulls_url":"https://api.github.com/repos/itiswicked/best_reads/pulls{/number}","milestones_url":"https://api.github.com/repos/itiswicked/best_reads/milestones{/number}","notifications_url":"https://api.github.com/repos/itiswicked/best_reads/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/itiswicked/best_reads/labels{/name}","releases_url":"https://api.github.com/repos/itiswicked/best_reads/releases{/id}","created_at":"2016-01-05T15:16:49Z","updated_at":"2016-01-05T19:14:31Z","pushed_at":"2016-01-06T20:05:36Z","git_url":"git://github.com/itiswicked/best_reads.git","ssh_url":"git@github.com:itiswicked/best_reads.git","clone_url":"https://github.com/itiswicked/best_reads.git","svn_url":"https://github.com/itiswicked/best_reads","homepage":null,"size":71,"stargazers_count":2,"watchers_count":2,"language":"Ruby","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":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/itiswicked/best_reads/pulls/5"},"html":{"href":"https://github.com/itiswicked/best_reads/pull/5"},"issue":{"href":"https://api.github.com/repos/itiswicked/best_reads/issues/5"},"comments":{"href":"https://api.github.com/repos/itiswicked/best_reads/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/itiswicked/best_reads/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/itiswicked/best_reads/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/itiswicked/best_reads/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/itiswicked/best_reads/statuses/6add3508982dcb53eaedf8584a13435ca1161664"}}}}