{"action":"created","comment":{"url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/comments/39439154","id":39439154,"diff_hunk":"@@ -0,0 +1,76 @@\n+class QuestionsController < ApplicationController\n+  before_action :find_question, only: [:show, :edit, :update, :destroy]\n+  before_action :authenticate_user, only: [:new, :create, :edit, :update, :destroy]\n+\n+  def index\n+    @question = Question.new\n+    @questions = Question.order_by_recent\n+  end\n+\n+  def trending\n+    @questions = Question.order_by_trending\n+    render :index\n+  end\n+\n+  def votes\n+    @questions = Question.order_by_votes\n+    render :index\n+  end\n+\n+  def search\n+    @questions = Question.where(\"title ILIKE ?\", \"%#{params[:search]}%\")\n+    @questions.order_by_recent\n+    render :index\n+  end\n+\n+  def show\n+    @comments = @question.comments\n+    @answers = @question.answers.includes(:comments)\n+    @vote = Vote.new\n+    @answer = Answer.new\n+    @comment = Comment.new\n+  end\n+\n+  def new\n+    @question = Question.new\n+  end\n+\n+  def create\n+    question = Question.new(question_params.merge(submitter: current_user))\n+    if question.save\n+      redirect_to question_path(question)\n+    else\n+      redirect_to new_question_path, flash: {error: \"Invalid input: must include both title and content.\"}","path":"app/controllers/questions_controller.rb","position":43,"original_position":43,"commit_id":"54abc82070e57eaa83b4c5fee126ca029dfc1b89","original_commit_id":"54abc82070e57eaa83b4c5fee126ca029dfc1b89","user":{"login":"stevecass","id":1823156,"avatar_url":"https://avatars.githubusercontent.com/u/1823156?v=3","gravatar_id":"","url":"https://api.github.com/users/stevecass","html_url":"https://github.com/stevecass","followers_url":"https://api.github.com/users/stevecass/followers","following_url":"https://api.github.com/users/stevecass/following{/other_user}","gists_url":"https://api.github.com/users/stevecass/gists{/gist_id}","starred_url":"https://api.github.com/users/stevecass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevecass/subscriptions","organizations_url":"https://api.github.com/users/stevecass/orgs","repos_url":"https://api.github.com/users/stevecass/repos","events_url":"https://api.github.com/users/stevecass/events{/privacy}","received_events_url":"https://api.github.com/users/stevecass/received_events","type":"User","site_admin":false},"body":"It might be preferable to either\r\na) re-render new so that the user doesn't necessarily lose the form input\r\nb) Let rails display the errors (use question.errors) ","created_at":"2015-09-14T19:57:59Z","updated_at":"2015-09-14T19:57:59Z","html_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow/pull/115#discussion_r39439154","pull_request_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/115","_links":{"self":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/comments/39439154"},"html":{"href":"https://github.com/nyc-fireflies-2015/JacquesOverflow/pull/115#discussion_r39439154"},"pull_request":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/115","id":44971121,"html_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow/pull/115","diff_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow/pull/115.diff","patch_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow/pull/115.patch","issue_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues/115","number":115,"state":"open","locked":false,"title":"Do not merge - review","user":{"login":"stevecass","id":1823156,"avatar_url":"https://avatars.githubusercontent.com/u/1823156?v=3","gravatar_id":"","url":"https://api.github.com/users/stevecass","html_url":"https://github.com/stevecass","followers_url":"https://api.github.com/users/stevecass/followers","following_url":"https://api.github.com/users/stevecass/following{/other_user}","gists_url":"https://api.github.com/users/stevecass/gists{/gist_id}","starred_url":"https://api.github.com/users/stevecass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevecass/subscriptions","organizations_url":"https://api.github.com/users/stevecass/orgs","repos_url":"https://api.github.com/users/stevecass/repos","events_url":"https://api.github.com/users/stevecass/events{/privacy}","received_events_url":"https://api.github.com/users/stevecass/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-14T19:37:03Z","updated_at":"2015-09-14T19:57:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a3c5a4562918ac66b8994f386ad6fae96888f2f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/115/commits","review_comments_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/115/comments","review_comment_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues/115/comments","statuses_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/statuses/54abc82070e57eaa83b4c5fee126ca029dfc1b89","head":{"label":"nyc-fireflies-2015:review_point","ref":"review_point","sha":"54abc82070e57eaa83b4c5fee126ca029dfc1b89","user":{"login":"nyc-fireflies-2015","id":10661837,"avatar_url":"https://avatars.githubusercontent.com/u/10661837?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-fireflies-2015","html_url":"https://github.com/nyc-fireflies-2015","followers_url":"https://api.github.com/users/nyc-fireflies-2015/followers","following_url":"https://api.github.com/users/nyc-fireflies-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-fireflies-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-fireflies-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-fireflies-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-fireflies-2015/orgs","repos_url":"https://api.github.com/users/nyc-fireflies-2015/repos","events_url":"https://api.github.com/users/nyc-fireflies-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-fireflies-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":42314890,"name":"JacquesOverflow","full_name":"nyc-fireflies-2015/JacquesOverflow","owner":{"login":"nyc-fireflies-2015","id":10661837,"avatar_url":"https://avatars.githubusercontent.com/u/10661837?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-fireflies-2015","html_url":"https://github.com/nyc-fireflies-2015","followers_url":"https://api.github.com/users/nyc-fireflies-2015/followers","following_url":"https://api.github.com/users/nyc-fireflies-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-fireflies-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-fireflies-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-fireflies-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-fireflies-2015/orgs","repos_url":"https://api.github.com/users/nyc-fireflies-2015/repos","events_url":"https://api.github.com/users/nyc-fireflies-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-fireflies-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow","description":"Stack Overflow, Frenchified","fork":false,"url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow","forks_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/forks","keys_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/teams","hooks_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/hooks","issue_events_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues/events{/number}","events_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/events","assignees_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/assignees{/user}","branches_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/branches{/branch}","tags_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/tags","blobs_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/statuses/{sha}","languages_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/languages","stargazers_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/stargazers","contributors_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/contributors","subscribers_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/subscribers","subscription_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/subscription","commits_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/contents/{+path}","compare_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/merges","archive_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/downloads","issues_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues{/number}","pulls_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls{/number}","milestones_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/milestones{/number}","notifications_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/labels{/name}","releases_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/releases{/id}","created_at":"2015-09-11T14:58:37Z","updated_at":"2015-09-11T22:10:03Z","pushed_at":"2015-09-14T19:37:05Z","git_url":"git://github.com/nyc-fireflies-2015/JacquesOverflow.git","ssh_url":"git@github.com:nyc-fireflies-2015/JacquesOverflow.git","clone_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow.git","svn_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow","homepage":"","size":772,"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":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"base":{"label":"nyc-fireflies-2015:review_base","ref":"review_base","sha":"1f560f9ef805c503765d0ae825ad94facb0b6913","user":{"login":"nyc-fireflies-2015","id":10661837,"avatar_url":"https://avatars.githubusercontent.com/u/10661837?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-fireflies-2015","html_url":"https://github.com/nyc-fireflies-2015","followers_url":"https://api.github.com/users/nyc-fireflies-2015/followers","following_url":"https://api.github.com/users/nyc-fireflies-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-fireflies-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-fireflies-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-fireflies-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-fireflies-2015/orgs","repos_url":"https://api.github.com/users/nyc-fireflies-2015/repos","events_url":"https://api.github.com/users/nyc-fireflies-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-fireflies-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":42314890,"name":"JacquesOverflow","full_name":"nyc-fireflies-2015/JacquesOverflow","owner":{"login":"nyc-fireflies-2015","id":10661837,"avatar_url":"https://avatars.githubusercontent.com/u/10661837?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-fireflies-2015","html_url":"https://github.com/nyc-fireflies-2015","followers_url":"https://api.github.com/users/nyc-fireflies-2015/followers","following_url":"https://api.github.com/users/nyc-fireflies-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-fireflies-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-fireflies-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-fireflies-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-fireflies-2015/orgs","repos_url":"https://api.github.com/users/nyc-fireflies-2015/repos","events_url":"https://api.github.com/users/nyc-fireflies-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-fireflies-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow","description":"Stack Overflow, Frenchified","fork":false,"url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow","forks_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/forks","keys_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/teams","hooks_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/hooks","issue_events_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues/events{/number}","events_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/events","assignees_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/assignees{/user}","branches_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/branches{/branch}","tags_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/tags","blobs_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/statuses/{sha}","languages_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/languages","stargazers_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/stargazers","contributors_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/contributors","subscribers_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/subscribers","subscription_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/subscription","commits_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/contents/{+path}","compare_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/merges","archive_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/downloads","issues_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues{/number}","pulls_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls{/number}","milestones_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/milestones{/number}","notifications_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/labels{/name}","releases_url":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/releases{/id}","created_at":"2015-09-11T14:58:37Z","updated_at":"2015-09-11T22:10:03Z","pushed_at":"2015-09-14T19:37:05Z","git_url":"git://github.com/nyc-fireflies-2015/JacquesOverflow.git","ssh_url":"git@github.com:nyc-fireflies-2015/JacquesOverflow.git","clone_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow.git","svn_url":"https://github.com/nyc-fireflies-2015/JacquesOverflow","homepage":"","size":772,"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":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/115"},"html":{"href":"https://github.com/nyc-fireflies-2015/JacquesOverflow/pull/115"},"issue":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues/115"},"comments":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/nyc-fireflies-2015/JacquesOverflow/statuses/54abc82070e57eaa83b4c5fee126ca029dfc1b89"}}}}