{"action":"created","comment":{"url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/comments/24951809","id":24951809,"diff_hunk":"@@ -0,0 +1,155 @@\n+get '/' do\n+  session[:id]\n+  erb :index\n+end\n+\n+get '/browse' do\n+  @all_dogs = Dog.all.sort\n+  erb :browse\n+end\n+\n+get '/search' do\n+  erb :search\n+end\n+\n+get '/search/results' do\n+  @breed_list = Dog.where(breed: params[:breed])\n+  p @breed_list.empty?\n+  erb :search_results\n+end\n+\n+get '/login/admin' do\n+\n+  erb :loginadmin\n+end\n+\n+post '/login/admin' do\n+  @admin = Admin.find_by(username: params[:username])\n+  if @admin && @admin.password == params[:password]\n+    session[:admin_id] = @admin.id\n+  else\n+    redirect '/login/admin'\n+  end\n+  redirect '/options'\n+end\n+\n+get '/login' do\n+  erb :login\n+end\n+\n+post '/login' do\n+  @volunteer = Volunteer.find_by(username: params[:username])\n+  #if the username matches the db, then, redirect them to the main page\n+  if @volunteer && @volunteer.password == params[:password]\n+    session[:volunteer_id] = @volunteer.id #it stores the volunteer_id, which indicates they are logged in so they don't have to keep logging in and you don't have to keep looking their volunteer info when they go to a different page\n+  else\n+    @error = true\n+    erb :login\n+  end\n+  redirect '/'\n+end\n+\n+get '/options' do\n+  @all_dogs = Dog.all.sort\n+  erb :options\n+end\n+\n+post '/options' do\n+  @rate_this_dog = Dog.find(params[:id])\n+\n+  redirect \"/options/#{params[:id]}/change\"\n+end\n+\n+get '/options/:id/change' do\n+  @view_dog = Dog.find(params[:id])\n+\n+  erb :changeprofile\n+end\n+\n+get '/dogs/:id/edit' do\n+  @edit_dog = Dog.find(params[:id])\n+\n+  erb :dogs_edit\n+end\n+\n+put '/dogs/:id/edit' do\n+  @edit_dog = Dog.find(params[:dog_id])\n+\n+  changes = params.select {|key, value| value != \"\"}\n+  changes.delete(\"_method\")\n+  changes.delete(\"dog_id\")\n+  changes.delete(\"splat\")\n+  changes.delete(\"captures\")\n+  changes.delete(\"id\")\n+  @edit_dog.update_attributes(changes)","path":"app/controllers/index.rb","position":84,"original_position":84,"commit_id":"db445f2e432755f3ee09313c3477a56da03dd4bd","original_commit_id":"db445f2e432755f3ee09313c3477a56da03dd4bd","user":{"login":"jareddbc","id":4805277,"avatar_url":"https://avatars.githubusercontent.com/u/4805277?v=3","gravatar_id":"","url":"https://api.github.com/users/jareddbc","html_url":"https://github.com/jareddbc","followers_url":"https://api.github.com/users/jareddbc/followers","following_url":"https://api.github.com/users/jareddbc/following{/other_user}","gists_url":"https://api.github.com/users/jareddbc/gists{/gist_id}","starred_url":"https://api.github.com/users/jareddbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareddbc/subscriptions","organizations_url":"https://api.github.com/users/jareddbc/orgs","repos_url":"https://api.github.com/users/jareddbc/repos","events_url":"https://api.github.com/users/jareddbc/events{/privacy}","received_events_url":"https://api.github.com/users/jareddbc/received_events","type":"User","site_admin":false},"body":"pull the things you want out of params rather than deleting things you dont want. White list is better than black list when it comes to params. ","created_at":"2015-02-18T23:24:26Z","updated_at":"2015-02-18T23:24:26Z","html_url":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project/pull/12#discussion_r24951809","pull_request_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/comments/24951809"},"html":{"href":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project/pull/12#discussion_r24951809"},"pull_request":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/12","id":28899786,"html_url":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project/pull/12","diff_url":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project/pull/12.diff","patch_url":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project/pull/12.patch","issue_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/issues/12","number":12,"state":"open","locked":false,"title":"Jessie's Passion Project: red dog","user":{"login":"jessiewuwu","id":8339031,"avatar_url":"https://avatars.githubusercontent.com/u/8339031?v=3","gravatar_id":"","url":"https://api.github.com/users/jessiewuwu","html_url":"https://github.com/jessiewuwu","followers_url":"https://api.github.com/users/jessiewuwu/followers","following_url":"https://api.github.com/users/jessiewuwu/following{/other_user}","gists_url":"https://api.github.com/users/jessiewuwu/gists{/gist_id}","starred_url":"https://api.github.com/users/jessiewuwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessiewuwu/subscriptions","organizations_url":"https://api.github.com/users/jessiewuwu/orgs","repos_url":"https://api.github.com/users/jessiewuwu/repos","events_url":"https://api.github.com/users/jessiewuwu/events{/privacy}","received_events_url":"https://api.github.com/users/jessiewuwu/received_events","type":"User","site_admin":false},"body":"2/9/2015: My project is now 99% complete. \r\n\r\n2/8/2015: My project is only 75% complete. ","created_at":"2015-02-09T06:54:17Z","updated_at":"2015-02-18T23:24:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2359bedf7d22771499e3b189a00c7fbe2ad2d69a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/12/commits","review_comments_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/12/comments","review_comment_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/issues/12/comments","statuses_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/statuses/db445f2e432755f3ee09313c3477a56da03dd4bd","head":{"label":"jessiewuwu:master","ref":"master","sha":"db445f2e432755f3ee09313c3477a56da03dd4bd","user":{"login":"jessiewuwu","id":8339031,"avatar_url":"https://avatars.githubusercontent.com/u/8339031?v=3","gravatar_id":"","url":"https://api.github.com/users/jessiewuwu","html_url":"https://github.com/jessiewuwu","followers_url":"https://api.github.com/users/jessiewuwu/followers","following_url":"https://api.github.com/users/jessiewuwu/following{/other_user}","gists_url":"https://api.github.com/users/jessiewuwu/gists{/gist_id}","starred_url":"https://api.github.com/users/jessiewuwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessiewuwu/subscriptions","organizations_url":"https://api.github.com/users/jessiewuwu/orgs","repos_url":"https://api.github.com/users/jessiewuwu/repos","events_url":"https://api.github.com/users/jessiewuwu/events{/privacy}","received_events_url":"https://api.github.com/users/jessiewuwu/received_events","type":"User","site_admin":false},"repo":{"id":30395404,"name":"ph2-pA-week-1-passion-project","full_name":"jessiewuwu/ph2-pA-week-1-passion-project","owner":{"login":"jessiewuwu","id":8339031,"avatar_url":"https://avatars.githubusercontent.com/u/8339031?v=3","gravatar_id":"","url":"https://api.github.com/users/jessiewuwu","html_url":"https://github.com/jessiewuwu","followers_url":"https://api.github.com/users/jessiewuwu/followers","following_url":"https://api.github.com/users/jessiewuwu/following{/other_user}","gists_url":"https://api.github.com/users/jessiewuwu/gists{/gist_id}","starred_url":"https://api.github.com/users/jessiewuwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessiewuwu/subscriptions","organizations_url":"https://api.github.com/users/jessiewuwu/orgs","repos_url":"https://api.github.com/users/jessiewuwu/repos","events_url":"https://api.github.com/users/jessiewuwu/events{/privacy}","received_events_url":"https://api.github.com/users/jessiewuwu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jessiewuwu/ph2-pA-week-1-passion-project","description":"","fork":true,"url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project","forks_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/forks","keys_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/teams","hooks_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/hooks","issue_events_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/issues/events{/number}","events_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/events","assignees_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/assignees{/user}","branches_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/branches{/branch}","tags_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/tags","blobs_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/statuses/{sha}","languages_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/languages","stargazers_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/stargazers","contributors_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/contributors","subscribers_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/subscribers","subscription_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/subscription","commits_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/issues/comments/{number}","contents_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/contents/{+path}","compare_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/merges","archive_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/downloads","issues_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/issues{/number}","pulls_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/pulls{/number}","milestones_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/milestones{/number}","notifications_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/labels{/name}","releases_url":"https://api.github.com/repos/jessiewuwu/ph2-pA-week-1-passion-project/releases{/id}","created_at":"2015-02-06T04:40:25Z","updated_at":"2015-02-18T23:09:22Z","pushed_at":"2015-02-18T23:09:22Z","git_url":"git://github.com/jessiewuwu/ph2-pA-week-1-passion-project.git","ssh_url":"git@github.com:jessiewuwu/ph2-pA-week-1-passion-project.git","clone_url":"https://github.com/jessiewuwu/ph2-pA-week-1-passion-project.git","svn_url":"https://github.com/jessiewuwu/ph2-pA-week-1-passion-project","homepage":null,"size":3708,"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":"sf-squirrels-2015:master","ref":"master","sha":"29609cb497d625caed0bec0fe0d03af9670828bc","user":{"login":"sf-squirrels-2015","id":10455711,"avatar_url":"https://avatars.githubusercontent.com/u/10455711?v=3","gravatar_id":"","url":"https://api.github.com/users/sf-squirrels-2015","html_url":"https://github.com/sf-squirrels-2015","followers_url":"https://api.github.com/users/sf-squirrels-2015/followers","following_url":"https://api.github.com/users/sf-squirrels-2015/following{/other_user}","gists_url":"https://api.github.com/users/sf-squirrels-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/sf-squirrels-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sf-squirrels-2015/subscriptions","organizations_url":"https://api.github.com/users/sf-squirrels-2015/orgs","repos_url":"https://api.github.com/users/sf-squirrels-2015/repos","events_url":"https://api.github.com/users/sf-squirrels-2015/events{/privacy}","received_events_url":"https://api.github.com/users/sf-squirrels-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":30276334,"name":"ph2-pA-week-1-passion-project","full_name":"sf-squirrels-2015/ph2-pA-week-1-passion-project","owner":{"login":"sf-squirrels-2015","id":10455711,"avatar_url":"https://avatars.githubusercontent.com/u/10455711?v=3","gravatar_id":"","url":"https://api.github.com/users/sf-squirrels-2015","html_url":"https://github.com/sf-squirrels-2015","followers_url":"https://api.github.com/users/sf-squirrels-2015/followers","following_url":"https://api.github.com/users/sf-squirrels-2015/following{/other_user}","gists_url":"https://api.github.com/users/sf-squirrels-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/sf-squirrels-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sf-squirrels-2015/subscriptions","organizations_url":"https://api.github.com/users/sf-squirrels-2015/orgs","repos_url":"https://api.github.com/users/sf-squirrels-2015/repos","events_url":"https://api.github.com/users/sf-squirrels-2015/events{/privacy}","received_events_url":"https://api.github.com/users/sf-squirrels-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project","description":"","fork":false,"url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project","forks_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/forks","keys_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/teams","hooks_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/hooks","issue_events_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/issues/events{/number}","events_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/events","assignees_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/assignees{/user}","branches_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/branches{/branch}","tags_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/tags","blobs_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/statuses/{sha}","languages_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/languages","stargazers_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/stargazers","contributors_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/contributors","subscribers_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/subscribers","subscription_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/subscription","commits_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/issues/comments/{number}","contents_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/contents/{+path}","compare_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/merges","archive_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/downloads","issues_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/issues{/number}","pulls_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls{/number}","milestones_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/milestones{/number}","notifications_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/labels{/name}","releases_url":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/releases{/id}","created_at":"2015-02-04T02:09:34Z","updated_at":"2015-02-04T02:09:34Z","pushed_at":"2015-02-07T21:33:49Z","git_url":"git://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project.git","ssh_url":"git@github.com:sf-squirrels-2015/ph2-pA-week-1-passion-project.git","clone_url":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project.git","svn_url":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project","homepage":null,"size":214,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":20,"forks":19,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/12"},"html":{"href":"https://github.com/sf-squirrels-2015/ph2-pA-week-1-passion-project/pull/12"},"issue":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/issues/12"},"comments":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/sf-squirrels-2015/ph2-pA-week-1-passion-project/statuses/db445f2e432755f3ee09313c3477a56da03dd4bd"}}}}