GitHub PullRequestEvent at 2014-09-23 23:43:51
Repository: guides
Actor: sgrif
Payload: {"action":"opened","number":232,"pull_request":{"url":"https://api.github.com/repos/thoughtbot/guides/pulls/232","id":21684053,"html_url":"https://github.com/thoughtbot/guides/pull/232","diff_url":"https://github.com/thoughtbot/guides/pull/232.diff","patch_url":"https://github.com/thoughtbot/guides/pull/232.patch","issue_url":"https://api.github.com/repos/thoughtbot/guides/issues/232","number":232,"state":"open","locked":false,"title":"Include `href` or `to_param` when constructing URLs client side","user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=2","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"body":"One nice feature that Rails provides is easy changes to URL generation\r\n(assuming the param starts with the ID). All you have to do is\r\n\r\n```ruby\r\ndef to_param\r\n  [id, name].to_param\r\nend\r\n```\r\n\r\nand everything \"Just Works\". This is lost, however, if you're manually\r\nconstructing URLs on the client side. This is avoided, if as a general\r\nrule of thumb, we let the server decide how to construct the URLs, and\r\npass that information along.","created_at":"2014-09-23T23:43:50Z","updated_at":"2014-09-23T23:43:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/guides/pulls/232/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/guides/pulls/232/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/guides/pulls/comments/{number}","comments_url":"https://api.github.com/repos/thoughtbot/guides/issues/232/comments","statuses_url":"https://api.github.com/repos/thoughtbot/guides/statuses/48a339772bab4b60b9dff7eac7ff2a296b2e5a4f","head":{"label":"thoughtbot:sg-to-param","ref":"sg-to-param","sha":"48a339772bab4b60b9dff7eac7ff2a296b2e5a4f","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=2","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":5200099,"name":"guides","full_name":"thoughtbot/guides","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=2","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/guides","description":"A guide for programming in style.","fork":false,"url":"https://api.github.com/repos/thoughtbot/guides","forks_url":"https://api.github.com/repos/thoughtbot/guides/forks","keys_url":"https://api.github.com/repos/thoughtbot/guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/guides/teams","hooks_url":"https://api.github.com/repos/thoughtbot/guides/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/guides/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/guides/events","assignees_url":"https://api.github.com/repos/thoughtbot/guides/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/guides/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/guides/tags","blobs_url":"https://api.github.com/repos/thoughtbot/guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/guides/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/guides/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/guides/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/guides/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/guides/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/guides/subscription","commits_url":"https://api.github.com/repos/thoughtbot/guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/guides/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/guides/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/guides/merges","archive_url":"https://api.github.com/repos/thoughtbot/guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/guides/downloads","issues_url":"https://api.github.com/repos/thoughtbot/guides/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/guides/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/guides/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/guides/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/guides/releases{/id}","created_at":"2012-07-27T03:15:44Z","updated_at":"2014-09-23T23:14:29Z","pushed_at":"2014-09-23T23:43:25Z","git_url":"git://github.com/thoughtbot/guides.git","ssh_url":"git@github.com:thoughtbot/guides.git","clone_url":"https://github.com/thoughtbot/guides.git","svn_url":"https://github.com/thoughtbot/guides","homepage":"","size":5903,"stargazers_count":2819,"watchers_count":2819,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":436,"mirror_url":null,"open_issues_count":13,"forks":436,"open_issues":13,"watchers":2819,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"accdda63a45c772dd8132ff0869c93c78e11fe17","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=2","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":5200099,"name":"guides","full_name":"thoughtbot/guides","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=2","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/guides","description":"A guide for programming in style.","fork":false,"url":"https://api.github.com/repos/thoughtbot/guides","forks_url":"https://api.github.com/repos/thoughtbot/guides/forks","keys_url":"https://api.github.com/repos/thoughtbot/guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/guides/teams","hooks_url":"https://api.github.com/repos/thoughtbot/guides/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/guides/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/guides/events","assignees_url":"https://api.github.com/repos/thoughtbot/guides/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/guides/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/guides/tags","blobs_url":"https://api.github.com/repos/thoughtbot/guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/guides/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/guides/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/guides/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/guides/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/guides/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/guides/subscription","commits_url":"https://api.github.com/repos/thoughtbot/guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/guides/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/guides/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/guides/merges","archive_url":"https://api.github.com/repos/thoughtbot/guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/guides/downloads","issues_url":"https://api.github.com/repos/thoughtbot/guides/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/guides/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/guides/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/guides/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/guides/releases{/id}","created_at":"2012-07-27T03:15:44Z","updated_at":"2014-09-23T23:14:29Z","pushed_at":"2014-09-23T23:43:25Z","git_url":"git://github.com/thoughtbot/guides.git","ssh_url":"git@github.com:thoughtbot/guides.git","clone_url":"https://github.com/thoughtbot/guides.git","svn_url":"https://github.com/thoughtbot/guides","homepage":"","size":5903,"stargazers_count":2819,"watchers_count":2819,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":436,"mirror_url":null,"open_issues_count":13,"forks":436,"open_issues":13,"watchers":2819,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/guides/pulls/232"},"html":{"href":"https://github.com/thoughtbot/guides/pull/232"},"issue":{"href":"https://api.github.com/repos/thoughtbot/guides/issues/232"},"comments":{"href":"https://api.github.com/repos/thoughtbot/guides/issues/232/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/guides/pulls/232/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/guides/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/guides/pulls/232/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/guides/statuses/48a339772bab4b60b9dff7eac7ff2a296b2e5a4f"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":0,"changed_files":1}}