{"action":"created","comment":{"url":"https://api.github.com/repos/ga-dc/curriculum/pulls/comments/43431520","id":43431520,"diff_hunk":"@@ -198,24 +267,55 @@ Let's compare the output of GET requests initiated in Postman and in the browser\n \n ## We do: Forms\n \n-Forms with a POST action are useful for creating new things.\n+Forms with a POST action are used for creating new things.\n+\n+Add this to `index.erb`:\n \n ```html\n-<form method='post' action='/'>\n-  <input type='text' name='student-name'>\n+<form method='post' action='/names'>\n+  <input type='text' name='student_name'>\n+  <input type='submit'>\n </form>\n ```\n \n-Any input with a `name` attribute will show up an element of `params`\n+Let's try submitting this form. OH NOES. Sinatra doesn't know this diddy.\n+\n+> Note that when we change whats in the action in the form. The diddy sinatra doesn't know changes to whatever is in that action form.\n+\n+Add this to `myapp.rb`:\n+\n+```ruby\n+post '/names' do\n+  names.push(params[:student_name])\n+end\n+```\n+\n+Let's try submitting again. What happened? Hmm, seems like whatever we type in gets rendered. Instead of that, I think it'd be really helpful if we just redirected to our names route after we push the name to the array.\n+\n+Update `myapp.rb`:\n+\n+```ruby\n+post '/names' do\n+  names.push(params[:student_name])\n+  redirect \"names\"\n+end\n+```\n+\n+> This is traditionally how post requests work. Where some creation functionality happens and then it redirects to a page.","path":"04-ruby-mvc-sinatra/sinatra-rest/readme.md","position":217,"original_position":217,"commit_id":"52e99a2fe8c21efd8e1a9a736a2561fb9f0c9940","original_commit_id":"52e99a2fe8c21efd8e1a9a736a2561fb9f0c9940","user":{"login":"jshawl","id":3824954,"avatar_url":"https://avatars.githubusercontent.com/u/3824954?v=3","gravatar_id":"","url":"https://api.github.com/users/jshawl","html_url":"https://github.com/jshawl","followers_url":"https://api.github.com/users/jshawl/followers","following_url":"https://api.github.com/users/jshawl/following{/other_user}","gists_url":"https://api.github.com/users/jshawl/gists{/gist_id}","starred_url":"https://api.github.com/users/jshawl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jshawl/subscriptions","organizations_url":"https://api.github.com/users/jshawl/orgs","repos_url":"https://api.github.com/users/jshawl/repos","events_url":"https://api.github.com/users/jshawl/events{/privacy}","received_events_url":"https://api.github.com/users/jshawl/received_events","type":"User","site_admin":false},"body":"can we create things with a get request? why might that be a bad idea?","created_at":"2015-10-29T19:15:19Z","updated_at":"2015-10-29T19:15:19Z","html_url":"https://github.com/ga-dc/curriculum/pull/395#discussion_r43431520","pull_request_url":"https://api.github.com/repos/ga-dc/curriculum/pulls/395","_links":{"self":{"href":"https://api.github.com/repos/ga-dc/curriculum/pulls/comments/43431520"},"html":{"href":"https://github.com/ga-dc/curriculum/pull/395#discussion_r43431520"},"pull_request":{"href":"https://api.github.com/repos/ga-dc/curriculum/pulls/395"}}},"pull_request":{"url":"https://api.github.com/repos/ga-dc/curriculum/pulls/395","id":49183602,"html_url":"https://github.com/ga-dc/curriculum/pull/395","diff_url":"https://github.com/ga-dc/curriculum/pull/395.diff","patch_url":"https://github.com/ga-dc/curriculum/pull/395.patch","issue_url":"https://api.github.com/repos/ga-dc/curriculum/issues/395","number":395,"state":"open","locked":false,"title":"Sinatra rest lesson plan update","user":{"login":"andrewsunglaekim","id":8976305,"avatar_url":"https://avatars.githubusercontent.com/u/8976305?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewsunglaekim","html_url":"https://github.com/andrewsunglaekim","followers_url":"https://api.github.com/users/andrewsunglaekim/followers","following_url":"https://api.github.com/users/andrewsunglaekim/following{/other_user}","gists_url":"https://api.github.com/users/andrewsunglaekim/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewsunglaekim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewsunglaekim/subscriptions","organizations_url":"https://api.github.com/users/andrewsunglaekim/orgs","repos_url":"https://api.github.com/users/andrewsunglaekim/repos","events_url":"https://api.github.com/users/andrewsunglaekim/events{/privacy}","received_events_url":"https://api.github.com/users/andrewsunglaekim/received_events","type":"User","site_admin":false},"body":"adds opening framing.\r\nadds clarifications\r\nadds code snippets","created_at":"2015-10-29T18:51:32Z","updated_at":"2015-10-29T19:15:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a637f1bc116ec69bcb646bccb0ae8c09760d053","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ga-dc/curriculum/pulls/395/commits","review_comments_url":"https://api.github.com/repos/ga-dc/curriculum/pulls/395/comments","review_comment_url":"https://api.github.com/repos/ga-dc/curriculum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ga-dc/curriculum/issues/395/comments","statuses_url":"https://api.github.com/repos/ga-dc/curriculum/statuses/52e99a2fe8c21efd8e1a9a736a2561fb9f0c9940","head":{"label":"andrewsunglaekim:sinatra_rest","ref":"sinatra_rest","sha":"52e99a2fe8c21efd8e1a9a736a2561fb9f0c9940","user":{"login":"andrewsunglaekim","id":8976305,"avatar_url":"https://avatars.githubusercontent.com/u/8976305?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewsunglaekim","html_url":"https://github.com/andrewsunglaekim","followers_url":"https://api.github.com/users/andrewsunglaekim/followers","following_url":"https://api.github.com/users/andrewsunglaekim/following{/other_user}","gists_url":"https://api.github.com/users/andrewsunglaekim/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewsunglaekim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewsunglaekim/subscriptions","organizations_url":"https://api.github.com/users/andrewsunglaekim/orgs","repos_url":"https://api.github.com/users/andrewsunglaekim/repos","events_url":"https://api.github.com/users/andrewsunglaekim/events{/privacy}","received_events_url":"https://api.github.com/users/andrewsunglaekim/received_events","type":"User","site_admin":false},"repo":{"id":37622897,"name":"pbj","full_name":"andrewsunglaekim/pbj","owner":{"login":"andrewsunglaekim","id":8976305,"avatar_url":"https://avatars.githubusercontent.com/u/8976305?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewsunglaekim","html_url":"https://github.com/andrewsunglaekim","followers_url":"https://api.github.com/users/andrewsunglaekim/followers","following_url":"https://api.github.com/users/andrewsunglaekim/following{/other_user}","gists_url":"https://api.github.com/users/andrewsunglaekim/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewsunglaekim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewsunglaekim/subscriptions","organizations_url":"https://api.github.com/users/andrewsunglaekim/orgs","repos_url":"https://api.github.com/users/andrewsunglaekim/repos","events_url":"https://api.github.com/users/andrewsunglaekim/events{/privacy}","received_events_url":"https://api.github.com/users/andrewsunglaekim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrewsunglaekim/pbj","description":"","fork":true,"url":"https://api.github.com/repos/andrewsunglaekim/pbj","forks_url":"https://api.github.com/repos/andrewsunglaekim/pbj/forks","keys_url":"https://api.github.com/repos/andrewsunglaekim/pbj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrewsunglaekim/pbj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrewsunglaekim/pbj/teams","hooks_url":"https://api.github.com/repos/andrewsunglaekim/pbj/hooks","issue_events_url":"https://api.github.com/repos/andrewsunglaekim/pbj/issues/events{/number}","events_url":"https://api.github.com/repos/andrewsunglaekim/pbj/events","assignees_url":"https://api.github.com/repos/andrewsunglaekim/pbj/assignees{/user}","branches_url":"https://api.github.com/repos/andrewsunglaekim/pbj/branches{/branch}","tags_url":"https://api.github.com/repos/andrewsunglaekim/pbj/tags","blobs_url":"https://api.github.com/repos/andrewsunglaekim/pbj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrewsunglaekim/pbj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrewsunglaekim/pbj/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrewsunglaekim/pbj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrewsunglaekim/pbj/statuses/{sha}","languages_url":"https://api.github.com/repos/andrewsunglaekim/pbj/languages","stargazers_url":"https://api.github.com/repos/andrewsunglaekim/pbj/stargazers","contributors_url":"https://api.github.com/repos/andrewsunglaekim/pbj/contributors","subscribers_url":"https://api.github.com/repos/andrewsunglaekim/pbj/subscribers","subscription_url":"https://api.github.com/repos/andrewsunglaekim/pbj/subscription","commits_url":"https://api.github.com/repos/andrewsunglaekim/pbj/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrewsunglaekim/pbj/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrewsunglaekim/pbj/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrewsunglaekim/pbj/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrewsunglaekim/pbj/contents/{+path}","compare_url":"https://api.github.com/repos/andrewsunglaekim/pbj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrewsunglaekim/pbj/merges","archive_url":"https://api.github.com/repos/andrewsunglaekim/pbj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrewsunglaekim/pbj/downloads","issues_url":"https://api.github.com/repos/andrewsunglaekim/pbj/issues{/number}","pulls_url":"https://api.github.com/repos/andrewsunglaekim/pbj/pulls{/number}","milestones_url":"https://api.github.com/repos/andrewsunglaekim/pbj/milestones{/number}","notifications_url":"https://api.github.com/repos/andrewsunglaekim/pbj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrewsunglaekim/pbj/labels{/name}","releases_url":"https://api.github.com/repos/andrewsunglaekim/pbj/releases{/id}","created_at":"2015-06-17T21:51:32Z","updated_at":"2015-07-19T19:35:43Z","pushed_at":"2015-10-29T18:53:50Z","git_url":"git://github.com/andrewsunglaekim/pbj.git","ssh_url":"git@github.com:andrewsunglaekim/pbj.git","clone_url":"https://github.com/andrewsunglaekim/pbj.git","svn_url":"https://github.com/andrewsunglaekim/pbj","homepage":null,"size":14911,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ga-dc:master","ref":"master","sha":"174c450fa841d1a4720062f93dd296c190221f9c","user":{"login":"ga-dc","id":10747017,"avatar_url":"https://avatars.githubusercontent.com/u/10747017?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-dc","html_url":"https://github.com/ga-dc","followers_url":"https://api.github.com/users/ga-dc/followers","following_url":"https://api.github.com/users/ga-dc/following{/other_user}","gists_url":"https://api.github.com/users/ga-dc/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-dc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-dc/subscriptions","organizations_url":"https://api.github.com/users/ga-dc/orgs","repos_url":"https://api.github.com/users/ga-dc/repos","events_url":"https://api.github.com/users/ga-dc/events{/privacy}","received_events_url":"https://api.github.com/users/ga-dc/received_events","type":"Organization","site_admin":false},"repo":{"id":36871385,"name":"curriculum","full_name":"ga-dc/curriculum","owner":{"login":"ga-dc","id":10747017,"avatar_url":"https://avatars.githubusercontent.com/u/10747017?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-dc","html_url":"https://github.com/ga-dc","followers_url":"https://api.github.com/users/ga-dc/followers","following_url":"https://api.github.com/users/ga-dc/following{/other_user}","gists_url":"https://api.github.com/users/ga-dc/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-dc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-dc/subscriptions","organizations_url":"https://api.github.com/users/ga-dc/orgs","repos_url":"https://api.github.com/users/ga-dc/repos","events_url":"https://api.github.com/users/ga-dc/events{/privacy}","received_events_url":"https://api.github.com/users/ga-dc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga-dc/curriculum","description":"","fork":false,"url":"https://api.github.com/repos/ga-dc/curriculum","forks_url":"https://api.github.com/repos/ga-dc/curriculum/forks","keys_url":"https://api.github.com/repos/ga-dc/curriculum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga-dc/curriculum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga-dc/curriculum/teams","hooks_url":"https://api.github.com/repos/ga-dc/curriculum/hooks","issue_events_url":"https://api.github.com/repos/ga-dc/curriculum/issues/events{/number}","events_url":"https://api.github.com/repos/ga-dc/curriculum/events","assignees_url":"https://api.github.com/repos/ga-dc/curriculum/assignees{/user}","branches_url":"https://api.github.com/repos/ga-dc/curriculum/branches{/branch}","tags_url":"https://api.github.com/repos/ga-dc/curriculum/tags","blobs_url":"https://api.github.com/repos/ga-dc/curriculum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga-dc/curriculum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga-dc/curriculum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga-dc/curriculum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga-dc/curriculum/statuses/{sha}","languages_url":"https://api.github.com/repos/ga-dc/curriculum/languages","stargazers_url":"https://api.github.com/repos/ga-dc/curriculum/stargazers","contributors_url":"https://api.github.com/repos/ga-dc/curriculum/contributors","subscribers_url":"https://api.github.com/repos/ga-dc/curriculum/subscribers","subscription_url":"https://api.github.com/repos/ga-dc/curriculum/subscription","commits_url":"https://api.github.com/repos/ga-dc/curriculum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga-dc/curriculum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga-dc/curriculum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga-dc/curriculum/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga-dc/curriculum/contents/{+path}","compare_url":"https://api.github.com/repos/ga-dc/curriculum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga-dc/curriculum/merges","archive_url":"https://api.github.com/repos/ga-dc/curriculum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga-dc/curriculum/downloads","issues_url":"https://api.github.com/repos/ga-dc/curriculum/issues{/number}","pulls_url":"https://api.github.com/repos/ga-dc/curriculum/pulls{/number}","milestones_url":"https://api.github.com/repos/ga-dc/curriculum/milestones{/number}","notifications_url":"https://api.github.com/repos/ga-dc/curriculum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga-dc/curriculum/labels{/name}","releases_url":"https://api.github.com/repos/ga-dc/curriculum/releases{/id}","created_at":"2015-06-04T13:18:59Z","updated_at":"2015-10-25T12:57:31Z","pushed_at":"2015-10-29T18:53:50Z","git_url":"git://github.com/ga-dc/curriculum.git","ssh_url":"git@github.com:ga-dc/curriculum.git","clone_url":"https://github.com/ga-dc/curriculum.git","svn_url":"https://github.com/ga-dc/curriculum","homepage":"https://ga-dc.github.io/curriculum/","size":119194,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":118,"mirror_url":null,"open_issues_count":49,"forks":118,"open_issues":49,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga-dc/curriculum/pulls/395"},"html":{"href":"https://github.com/ga-dc/curriculum/pull/395"},"issue":{"href":"https://api.github.com/repos/ga-dc/curriculum/issues/395"},"comments":{"href":"https://api.github.com/repos/ga-dc/curriculum/issues/395/comments"},"review_comments":{"href":"https://api.github.com/repos/ga-dc/curriculum/pulls/395/comments"},"review_comment":{"href":"https://api.github.com/repos/ga-dc/curriculum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ga-dc/curriculum/pulls/395/commits"},"statuses":{"href":"https://api.github.com/repos/ga-dc/curriculum/statuses/52e99a2fe8c21efd8e1a9a736a2561fb9f0c9940"}}}}