{"action":"created","comment":{"url":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/comments/90769596","pull_request_review_id":11287781,"id":90769596,"diff_hunk":"@@ -0,0 +1,48 @@\n+# require gems\n+require 'sinatra'\n+require 'sqlite3'\n+\n+set :public_folder, File.dirname(__FILE__) + '/static' # Here we set the public folder to the directory 'static'. The syntax here just more Sinatra boilerplate stuff (no need to memorize).\n+\n+db = SQLite3::Database.new(\"students.db\")\n+db.results_as_hash = true\n+\n+# show students on the home page\n+get '/' do # Creates our \"root\" page.\n+  @students = db.execute(\"SELECT * FROM students\") # The '@' lets us put the variable 'students' into our ERB template. Another Sinatra convention.\n+  erb :home # 'erb' is a method that takes a filename (as a symbol with no file extension) as an argument. Just more Sinatra convention.\n+end\n+\n+get '/students/new' do # This URL syntax is a common convention.\n+  # \"New student form will go here.\" # Just to test things out.\n+  erb :new_student # Now the form is \"up and running\".\n+end\n+\n+# create new students via\n+# a form\n+post '/students' do # This lets us receive a 'POST' request.\n+  # p params # Lets us see the data we get from the form in the console. We see that the 'age' data was submitted as a string (typical form behavior), so we need to change that. Be aware of data types.\n+  db.execute(\"INSERT INTO students (name, campus, age) VALUES (?,?,?)\", [params['name'], params['campus'], params['age'].to_i]) # Takes data entered into form and puts it into the students database. 'age' data is converted to an integer.\n+  redirect '/' # Redirects back to the page with the list of students.\n+end\n+\n+# add static resources\n+  # Sometimes the 'static' directory is called 'public'.\n+# SEE ABOVE (line 5)\n+\n+\n+\n+\n+","path":"web_dev/sinatra_templating/app_notes.rb","position":36,"original_position":36,"commit_id":"b497baf0011cd40354effb85cfeb7dc30a815811","original_commit_id":"b497baf0011cd40354effb85cfeb7dc30a815811","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Extra blank line detected.","created_at":"2016-12-04T03:10:29Z","updated_at":"2016-12-04T03:10:29Z","html_url":"https://github.com/D-Maher/phase-0-tracks/pull/51#discussion_r90769596","pull_request_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/comments/90769596"},"html":{"href":"https://github.com/D-Maher/phase-0-tracks/pull/51#discussion_r90769596"},"pull_request":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/51","id":96419638,"html_url":"https://github.com/D-Maher/phase-0-tracks/pull/51","diff_url":"https://github.com/D-Maher/phase-0-tracks/pull/51.diff","patch_url":"https://github.com/D-Maher/phase-0-tracks/pull/51.patch","issue_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues/51","number":51,"state":"open","locked":false,"title":"9.5 sinatra templating","user":{"login":"D-Maher","id":22512071,"avatar_url":"https://avatars.githubusercontent.com/u/22512071?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Maher","html_url":"https://github.com/D-Maher","followers_url":"https://api.github.com/users/D-Maher/followers","following_url":"https://api.github.com/users/D-Maher/following{/other_user}","gists_url":"https://api.github.com/users/D-Maher/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Maher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Maher/subscriptions","organizations_url":"https://api.github.com/users/D-Maher/orgs","repos_url":"https://api.github.com/users/D-Maher/repos","events_url":"https://api.github.com/users/D-Maher/events{/privacy}","received_events_url":"https://api.github.com/users/D-Maher/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-04T03:10:20Z","updated_at":"2016-12-04T03:10:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb8b32c242358cd2f0481feaa93fc067f30e7790","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/51/commits","review_comments_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/51/comments","review_comment_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues/51/comments","statuses_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/statuses/b497baf0011cd40354effb85cfeb7dc30a815811","head":{"label":"D-Maher:9.5-sinatra-templating","ref":"9.5-sinatra-templating","sha":"b497baf0011cd40354effb85cfeb7dc30a815811","user":{"login":"D-Maher","id":22512071,"avatar_url":"https://avatars.githubusercontent.com/u/22512071?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Maher","html_url":"https://github.com/D-Maher","followers_url":"https://api.github.com/users/D-Maher/followers","following_url":"https://api.github.com/users/D-Maher/following{/other_user}","gists_url":"https://api.github.com/users/D-Maher/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Maher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Maher/subscriptions","organizations_url":"https://api.github.com/users/D-Maher/orgs","repos_url":"https://api.github.com/users/D-Maher/repos","events_url":"https://api.github.com/users/D-Maher/events{/privacy}","received_events_url":"https://api.github.com/users/D-Maher/received_events","type":"User","site_admin":false},"repo":{"id":70432294,"name":"phase-0-tracks","full_name":"D-Maher/phase-0-tracks","owner":{"login":"D-Maher","id":22512071,"avatar_url":"https://avatars.githubusercontent.com/u/22512071?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Maher","html_url":"https://github.com/D-Maher","followers_url":"https://api.github.com/users/D-Maher/followers","following_url":"https://api.github.com/users/D-Maher/following{/other_user}","gists_url":"https://api.github.com/users/D-Maher/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Maher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Maher/subscriptions","organizations_url":"https://api.github.com/users/D-Maher/orgs","repos_url":"https://api.github.com/users/D-Maher/repos","events_url":"https://api.github.com/users/D-Maher/events{/privacy}","received_events_url":"https://api.github.com/users/D-Maher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/D-Maher/phase-0-tracks","description":null,"fork":true,"url":"https://api.github.com/repos/D-Maher/phase-0-tracks","forks_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/forks","keys_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/teams","hooks_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/hooks","issue_events_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues/events{/number}","events_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/events","assignees_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/assignees{/user}","branches_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/branches{/branch}","tags_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/tags","blobs_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/refs{/sha}","trees_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/statuses/{sha}","languages_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/languages","stargazers_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/stargazers","contributors_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/contributors","subscribers_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/subscribers","subscription_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/subscription","commits_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/commits{/sha}","git_commits_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/commits{/sha}","comments_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/comments{/number}","issue_comment_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues/comments{/number}","contents_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/contents/{+path}","compare_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/merges","archive_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/downloads","issues_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues{/number}","pulls_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls{/number}","milestones_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/milestones{/number}","notifications_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/labels{/name}","releases_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/releases{/id}","deployments_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/deployments","created_at":"2016-10-09T21:45:23Z","updated_at":"2016-11-10T21:25:21Z","pushed_at":"2016-12-04T03:10:20Z","git_url":"git://github.com/D-Maher/phase-0-tracks.git","ssh_url":"git@github.com:D-Maher/phase-0-tracks.git","clone_url":"https://github.com/D-Maher/phase-0-tracks.git","svn_url":"https://github.com/D-Maher/phase-0-tracks","homepage":null,"size":4274,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"D-Maher:master","ref":"master","sha":"11073dea4f3f7b0ee941adfee89de795965270b0","user":{"login":"D-Maher","id":22512071,"avatar_url":"https://avatars.githubusercontent.com/u/22512071?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Maher","html_url":"https://github.com/D-Maher","followers_url":"https://api.github.com/users/D-Maher/followers","following_url":"https://api.github.com/users/D-Maher/following{/other_user}","gists_url":"https://api.github.com/users/D-Maher/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Maher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Maher/subscriptions","organizations_url":"https://api.github.com/users/D-Maher/orgs","repos_url":"https://api.github.com/users/D-Maher/repos","events_url":"https://api.github.com/users/D-Maher/events{/privacy}","received_events_url":"https://api.github.com/users/D-Maher/received_events","type":"User","site_admin":false},"repo":{"id":70432294,"name":"phase-0-tracks","full_name":"D-Maher/phase-0-tracks","owner":{"login":"D-Maher","id":22512071,"avatar_url":"https://avatars.githubusercontent.com/u/22512071?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Maher","html_url":"https://github.com/D-Maher","followers_url":"https://api.github.com/users/D-Maher/followers","following_url":"https://api.github.com/users/D-Maher/following{/other_user}","gists_url":"https://api.github.com/users/D-Maher/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Maher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Maher/subscriptions","organizations_url":"https://api.github.com/users/D-Maher/orgs","repos_url":"https://api.github.com/users/D-Maher/repos","events_url":"https://api.github.com/users/D-Maher/events{/privacy}","received_events_url":"https://api.github.com/users/D-Maher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/D-Maher/phase-0-tracks","description":null,"fork":true,"url":"https://api.github.com/repos/D-Maher/phase-0-tracks","forks_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/forks","keys_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/teams","hooks_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/hooks","issue_events_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues/events{/number}","events_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/events","assignees_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/assignees{/user}","branches_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/branches{/branch}","tags_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/tags","blobs_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/refs{/sha}","trees_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/statuses/{sha}","languages_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/languages","stargazers_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/stargazers","contributors_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/contributors","subscribers_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/subscribers","subscription_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/subscription","commits_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/commits{/sha}","git_commits_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/git/commits{/sha}","comments_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/comments{/number}","issue_comment_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues/comments{/number}","contents_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/contents/{+path}","compare_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/merges","archive_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/downloads","issues_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues{/number}","pulls_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls{/number}","milestones_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/milestones{/number}","notifications_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/labels{/name}","releases_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/releases{/id}","deployments_url":"https://api.github.com/repos/D-Maher/phase-0-tracks/deployments","created_at":"2016-10-09T21:45:23Z","updated_at":"2016-11-10T21:25:21Z","pushed_at":"2016-12-04T03:10:20Z","git_url":"git://github.com/D-Maher/phase-0-tracks.git","ssh_url":"git@github.com:D-Maher/phase-0-tracks.git","clone_url":"https://github.com/D-Maher/phase-0-tracks.git","svn_url":"https://github.com/D-Maher/phase-0-tracks","homepage":null,"size":4274,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/51"},"html":{"href":"https://github.com/D-Maher/phase-0-tracks/pull/51"},"issue":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues/51"},"comments":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/D-Maher/phase-0-tracks/statuses/b497baf0011cd40354effb85cfeb7dc30a815811"}}}}
{"actor":{"display_login":"houndci-bot"}}