{"action":"created","comment":{"url":"https://api.github.com/repos/pakyow/pakyow/pulls/comments/78381753","id":78381753,"diff_hunk":"@@ -0,0 +1,65 @@\n+module Pakyow\n+  module Presenter\n+    class Form\n+\n+      attr_reader :form_view, :context\n+\n+      def initialize(view, context)\n+        @form_view = view\n+        @context = context\n+      end\n+\n+      def create(*binding_args, &block)\n+        bind_data(binding_args, block) do |routes, view|\n+          view.attrs.action = routes.path(:create, request_params) if routes\n+        end\n+      end\n+\n+      def update(*binding_args, &block)\n+        bind_data(binding_args, block) do |routes, view|\n+          if routes\n+            route_params = request_params.merge(\n+              :\"#{scoped_as}_id\" => view.attrs.__send__('data-id').value\n+            )\n+\n+            view.attrs.action = routes.path(:update, route_params)\n+          end\n+\n+          view.prepend(\n+            View.new('<input type=\"hidden\" name=\"_method\" value=\"patch\">')","path":"pakyow-presenter/lib/pakyow/presenter/form.rb","position":29,"original_position":29,"commit_id":"769487a02034a49f3a943e10e220e57ca473745b","original_commit_id":"769487a02034a49f3a943e10e220e57ca473745b","user":{"login":"bryanp","id":18920,"avatar_url":"https://avatars.githubusercontent.com/u/18920?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanp","html_url":"https://github.com/bryanp","followers_url":"https://api.github.com/users/bryanp/followers","following_url":"https://api.github.com/users/bryanp/following{/other_user}","gists_url":"https://api.github.com/users/bryanp/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanp/subscriptions","organizations_url":"https://api.github.com/users/bryanp/orgs","repos_url":"https://api.github.com/users/bryanp/repos","events_url":"https://api.github.com/users/bryanp/events{/privacy}","received_events_url":"https://api.github.com/users/bryanp/received_events","type":"User","site_admin":false},"body":"Let's move the HTML string to a constant.","created_at":"2016-09-12T14:22:56Z","updated_at":"2016-09-12T14:22:56Z","html_url":"https://github.com/pakyow/pakyow/pull/195#discussion_r78381753","pull_request_url":"https://api.github.com/repos/pakyow/pakyow/pulls/195","_links":{"self":{"href":"https://api.github.com/repos/pakyow/pakyow/pulls/comments/78381753"},"html":{"href":"https://github.com/pakyow/pakyow/pull/195#discussion_r78381753"},"pull_request":{"href":"https://api.github.com/repos/pakyow/pakyow/pulls/195"}}},"pull_request":{"url":"https://api.github.com/repos/pakyow/pakyow/pulls/195","id":84488086,"html_url":"https://github.com/pakyow/pakyow/pull/195","diff_url":"https://github.com/pakyow/pakyow/pull/195.diff","patch_url":"https://github.com/pakyow/pakyow/pull/195.patch","issue_url":"https://api.github.com/repos/pakyow/pakyow/issues/195","number":195,"state":"open","locked":false,"title":"Issue 96","user":{"login":"jphager2","id":4079978,"avatar_url":"https://avatars.githubusercontent.com/u/4079978?v=3","gravatar_id":"","url":"https://api.github.com/users/jphager2","html_url":"https://github.com/jphager2","followers_url":"https://api.github.com/users/jphager2/followers","following_url":"https://api.github.com/users/jphager2/following{/other_user}","gists_url":"https://api.github.com/users/jphager2/gists{/gist_id}","starred_url":"https://api.github.com/users/jphager2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jphager2/subscriptions","organizations_url":"https://api.github.com/users/jphager2/orgs","repos_url":"https://api.github.com/users/jphager2/repos","events_url":"https://api.github.com/users/jphager2/events{/privacy}","received_events_url":"https://api.github.com/users/jphager2/received_events","type":"User","site_admin":false},"body":"This is a work in progress. (also see the TODOs)\r\n\r\nThis provides the api for managing forms.\r\n\r\n```ruby\r\nview.form(:user).create(User.new) do |form, user|\r\n  # ... extra manipulation of the form view\r\nend\r\n\r\nview.form(:user).update(User.find(1))\r\n```\r\n\r\n`View#form` is simply a alias for `View#scope` and `#create` and `#update` (for both `View` and `ViewCollection`) uses bind to preform the normal data binding, then adds the specific form data, then passes the view to the block passed by the caller.","created_at":"2016-09-08T14:27:47Z","updated_at":"2016-09-12T14:22:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db20fba6568194ea352c1cdae1ce28792bf6bbcb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pakyow/pakyow/pulls/195/commits","review_comments_url":"https://api.github.com/repos/pakyow/pakyow/pulls/195/comments","review_comment_url":"https://api.github.com/repos/pakyow/pakyow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pakyow/pakyow/issues/195/comments","statuses_url":"https://api.github.com/repos/pakyow/pakyow/statuses/769487a02034a49f3a943e10e220e57ca473745b","head":{"label":"jphager2:issue-96","ref":"issue-96","sha":"769487a02034a49f3a943e10e220e57ca473745b","user":{"login":"jphager2","id":4079978,"avatar_url":"https://avatars.githubusercontent.com/u/4079978?v=3","gravatar_id":"","url":"https://api.github.com/users/jphager2","html_url":"https://github.com/jphager2","followers_url":"https://api.github.com/users/jphager2/followers","following_url":"https://api.github.com/users/jphager2/following{/other_user}","gists_url":"https://api.github.com/users/jphager2/gists{/gist_id}","starred_url":"https://api.github.com/users/jphager2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jphager2/subscriptions","organizations_url":"https://api.github.com/users/jphager2/orgs","repos_url":"https://api.github.com/users/jphager2/repos","events_url":"https://api.github.com/users/jphager2/events{/privacy}","received_events_url":"https://api.github.com/users/jphager2/received_events","type":"User","site_admin":false},"repo":{"id":47770533,"name":"pakyow","full_name":"jphager2/pakyow","owner":{"login":"jphager2","id":4079978,"avatar_url":"https://avatars.githubusercontent.com/u/4079978?v=3","gravatar_id":"","url":"https://api.github.com/users/jphager2","html_url":"https://github.com/jphager2","followers_url":"https://api.github.com/users/jphager2/followers","following_url":"https://api.github.com/users/jphager2/following{/other_user}","gists_url":"https://api.github.com/users/jphager2/gists{/gist_id}","starred_url":"https://api.github.com/users/jphager2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jphager2/subscriptions","organizations_url":"https://api.github.com/users/jphager2/orgs","repos_url":"https://api.github.com/users/jphager2/repos","events_url":"https://api.github.com/users/jphager2/events{/privacy}","received_events_url":"https://api.github.com/users/jphager2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jphager2/pakyow","description":"Realtime Web Framework for Ruby","fork":true,"url":"https://api.github.com/repos/jphager2/pakyow","forks_url":"https://api.github.com/repos/jphager2/pakyow/forks","keys_url":"https://api.github.com/repos/jphager2/pakyow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jphager2/pakyow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jphager2/pakyow/teams","hooks_url":"https://api.github.com/repos/jphager2/pakyow/hooks","issue_events_url":"https://api.github.com/repos/jphager2/pakyow/issues/events{/number}","events_url":"https://api.github.com/repos/jphager2/pakyow/events","assignees_url":"https://api.github.com/repos/jphager2/pakyow/assignees{/user}","branches_url":"https://api.github.com/repos/jphager2/pakyow/branches{/branch}","tags_url":"https://api.github.com/repos/jphager2/pakyow/tags","blobs_url":"https://api.github.com/repos/jphager2/pakyow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jphager2/pakyow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jphager2/pakyow/git/refs{/sha}","trees_url":"https://api.github.com/repos/jphager2/pakyow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jphager2/pakyow/statuses/{sha}","languages_url":"https://api.github.com/repos/jphager2/pakyow/languages","stargazers_url":"https://api.github.com/repos/jphager2/pakyow/stargazers","contributors_url":"https://api.github.com/repos/jphager2/pakyow/contributors","subscribers_url":"https://api.github.com/repos/jphager2/pakyow/subscribers","subscription_url":"https://api.github.com/repos/jphager2/pakyow/subscription","commits_url":"https://api.github.com/repos/jphager2/pakyow/commits{/sha}","git_commits_url":"https://api.github.com/repos/jphager2/pakyow/git/commits{/sha}","comments_url":"https://api.github.com/repos/jphager2/pakyow/comments{/number}","issue_comment_url":"https://api.github.com/repos/jphager2/pakyow/issues/comments{/number}","contents_url":"https://api.github.com/repos/jphager2/pakyow/contents/{+path}","compare_url":"https://api.github.com/repos/jphager2/pakyow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jphager2/pakyow/merges","archive_url":"https://api.github.com/repos/jphager2/pakyow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jphager2/pakyow/downloads","issues_url":"https://api.github.com/repos/jphager2/pakyow/issues{/number}","pulls_url":"https://api.github.com/repos/jphager2/pakyow/pulls{/number}","milestones_url":"https://api.github.com/repos/jphager2/pakyow/milestones{/number}","notifications_url":"https://api.github.com/repos/jphager2/pakyow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jphager2/pakyow/labels{/name}","releases_url":"https://api.github.com/repos/jphager2/pakyow/releases{/id}","deployments_url":"https://api.github.com/repos/jphager2/pakyow/deployments","created_at":"2015-12-10T15:33:01Z","updated_at":"2016-01-12T05:41:14Z","pushed_at":"2016-09-11T20:58:10Z","git_url":"git://github.com/jphager2/pakyow.git","ssh_url":"git@github.com:jphager2/pakyow.git","clone_url":"https://github.com/jphager2/pakyow.git","svn_url":"https://github.com/jphager2/pakyow","homepage":"https://pakyow.org","size":1942,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"pakyow:master","ref":"master","sha":"88c9832e9c0369c0c42c06e41f170c27d221bd73","user":{"login":"pakyow","id":8939235,"avatar_url":"https://avatars.githubusercontent.com/u/8939235?v=3","gravatar_id":"","url":"https://api.github.com/users/pakyow","html_url":"https://github.com/pakyow","followers_url":"https://api.github.com/users/pakyow/followers","following_url":"https://api.github.com/users/pakyow/following{/other_user}","gists_url":"https://api.github.com/users/pakyow/gists{/gist_id}","starred_url":"https://api.github.com/users/pakyow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakyow/subscriptions","organizations_url":"https://api.github.com/users/pakyow/orgs","repos_url":"https://api.github.com/users/pakyow/repos","events_url":"https://api.github.com/users/pakyow/events{/privacy}","received_events_url":"https://api.github.com/users/pakyow/received_events","type":"Organization","site_admin":false},"repo":{"id":970401,"name":"pakyow","full_name":"pakyow/pakyow","owner":{"login":"pakyow","id":8939235,"avatar_url":"https://avatars.githubusercontent.com/u/8939235?v=3","gravatar_id":"","url":"https://api.github.com/users/pakyow","html_url":"https://github.com/pakyow","followers_url":"https://api.github.com/users/pakyow/followers","following_url":"https://api.github.com/users/pakyow/following{/other_user}","gists_url":"https://api.github.com/users/pakyow/gists{/gist_id}","starred_url":"https://api.github.com/users/pakyow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakyow/subscriptions","organizations_url":"https://api.github.com/users/pakyow/orgs","repos_url":"https://api.github.com/users/pakyow/repos","events_url":"https://api.github.com/users/pakyow/events{/privacy}","received_events_url":"https://api.github.com/users/pakyow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pakyow/pakyow","description":"Web Framework for Ruby","fork":false,"url":"https://api.github.com/repos/pakyow/pakyow","forks_url":"https://api.github.com/repos/pakyow/pakyow/forks","keys_url":"https://api.github.com/repos/pakyow/pakyow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pakyow/pakyow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pakyow/pakyow/teams","hooks_url":"https://api.github.com/repos/pakyow/pakyow/hooks","issue_events_url":"https://api.github.com/repos/pakyow/pakyow/issues/events{/number}","events_url":"https://api.github.com/repos/pakyow/pakyow/events","assignees_url":"https://api.github.com/repos/pakyow/pakyow/assignees{/user}","branches_url":"https://api.github.com/repos/pakyow/pakyow/branches{/branch}","tags_url":"https://api.github.com/repos/pakyow/pakyow/tags","blobs_url":"https://api.github.com/repos/pakyow/pakyow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pakyow/pakyow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pakyow/pakyow/git/refs{/sha}","trees_url":"https://api.github.com/repos/pakyow/pakyow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pakyow/pakyow/statuses/{sha}","languages_url":"https://api.github.com/repos/pakyow/pakyow/languages","stargazers_url":"https://api.github.com/repos/pakyow/pakyow/stargazers","contributors_url":"https://api.github.com/repos/pakyow/pakyow/contributors","subscribers_url":"https://api.github.com/repos/pakyow/pakyow/subscribers","subscription_url":"https://api.github.com/repos/pakyow/pakyow/subscription","commits_url":"https://api.github.com/repos/pakyow/pakyow/commits{/sha}","git_commits_url":"https://api.github.com/repos/pakyow/pakyow/git/commits{/sha}","comments_url":"https://api.github.com/repos/pakyow/pakyow/comments{/number}","issue_comment_url":"https://api.github.com/repos/pakyow/pakyow/issues/comments{/number}","contents_url":"https://api.github.com/repos/pakyow/pakyow/contents/{+path}","compare_url":"https://api.github.com/repos/pakyow/pakyow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pakyow/pakyow/merges","archive_url":"https://api.github.com/repos/pakyow/pakyow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pakyow/pakyow/downloads","issues_url":"https://api.github.com/repos/pakyow/pakyow/issues{/number}","pulls_url":"https://api.github.com/repos/pakyow/pakyow/pulls{/number}","milestones_url":"https://api.github.com/repos/pakyow/pakyow/milestones{/number}","notifications_url":"https://api.github.com/repos/pakyow/pakyow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pakyow/pakyow/labels{/name}","releases_url":"https://api.github.com/repos/pakyow/pakyow/releases{/id}","deployments_url":"https://api.github.com/repos/pakyow/pakyow/deployments","created_at":"2010-10-07T20:06:09Z","updated_at":"2016-09-08T03:43:03Z","pushed_at":"2016-09-12T14:10:19Z","git_url":"git://github.com/pakyow/pakyow.git","ssh_url":"git@github.com:pakyow/pakyow.git","clone_url":"https://github.com/pakyow/pakyow.git","svn_url":"https://github.com/pakyow/pakyow","homepage":"https://pakyow.org","size":2218,"stargazers_count":675,"watchers_count":675,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":58,"mirror_url":null,"open_issues_count":38,"forks":58,"open_issues":38,"watchers":675,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pakyow/pakyow/pulls/195"},"html":{"href":"https://github.com/pakyow/pakyow/pull/195"},"issue":{"href":"https://api.github.com/repos/pakyow/pakyow/issues/195"},"comments":{"href":"https://api.github.com/repos/pakyow/pakyow/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/pakyow/pakyow/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/pakyow/pakyow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pakyow/pakyow/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/pakyow/pakyow/statuses/769487a02034a49f3a943e10e220e57ca473745b"}}}}
{"actor":{"display_login":"bryanp"}}