{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments/44622448","id":44622448,"diff_hunk":"@@ -18,7 +18,7 @@ By default, the relationship is rendered as a link to the associated object.\n \n <% if field.data %>\n   <%= link_to(\n-    field.data.to_s,\n-    polymorphic_path([:admin, field.data])\n+    field.displayed_associated_resource,","path":"app/views/fields/polymorphic/_show.html.erb","position":6,"original_position":6,"commit_id":"df6c1932bb8b7fd4b991b55eca13aeaef942f7ae","original_commit_id":"df6c1932bb8b7fd4b991b55eca13aeaef942f7ae","user":{"login":"graysonwright","id":829576,"avatar_url":"https://avatars.githubusercontent.com/u/829576?v=3","gravatar_id":"","url":"https://api.github.com/users/graysonwright","html_url":"https://github.com/graysonwright","followers_url":"https://api.github.com/users/graysonwright/followers","following_url":"https://api.github.com/users/graysonwright/following{/other_user}","gists_url":"https://api.github.com/users/graysonwright/gists{/gist_id}","starred_url":"https://api.github.com/users/graysonwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graysonwright/subscriptions","organizations_url":"https://api.github.com/users/graysonwright/orgs","repos_url":"https://api.github.com/users/graysonwright/repos","events_url":"https://api.github.com/users/graysonwright/events{/privacy}","received_events_url":"https://api.github.com/users/graysonwright/received_events","type":"User","site_admin":false},"body":"After seeing this in practice, I think I prefer `display_associated_resource`. There's something about `displayed` that doesn't read quite right.","created_at":"2015-11-12T05:22:31Z","updated_at":"2015-11-12T05:22:31Z","html_url":"https://github.com/thoughtbot/administrate/pull/191#discussion_r44622448","pull_request_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/191","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments/44622448"},"html":{"href":"https://github.com/thoughtbot/administrate/pull/191#discussion_r44622448"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/191"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/administrate/pulls/191","id":50057034,"html_url":"https://github.com/thoughtbot/administrate/pull/191","diff_url":"https://github.com/thoughtbot/administrate/pull/191.diff","patch_url":"https://github.com/thoughtbot/administrate/pull/191.patch","issue_url":"https://api.github.com/repos/thoughtbot/administrate/issues/191","number":191,"state":"open","locked":false,"title":"Improve default resource display","user":{"login":"graysonwright","id":829576,"avatar_url":"https://avatars.githubusercontent.com/u/829576?v=3","gravatar_id":"","url":"https://api.github.com/users/graysonwright","html_url":"https://github.com/graysonwright","followers_url":"https://api.github.com/users/graysonwright/followers","following_url":"https://api.github.com/users/graysonwright/following{/other_user}","gists_url":"https://api.github.com/users/graysonwright/gists{/gist_id}","starred_url":"https://api.github.com/users/graysonwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graysonwright/subscriptions","organizations_url":"https://api.github.com/users/graysonwright/orgs","repos_url":"https://api.github.com/users/graysonwright/repos","events_url":"https://api.github.com/users/graysonwright/events{/privacy}","received_events_url":"https://api.github.com/users/graysonwright/received_events","type":"User","site_admin":false},"body":"Closes #129\r\n\r\n## Problem:\r\n\r\nAdministrate relies on `#to_s`\r\nto display resources throughout the system.\r\nIn order to get Administrate working correctly,\r\ndevelopers must define `#to_s` on all models\r\nthat will be displayed in the admin dashboard.\r\n\r\nThis process is not documented,\r\ncan be confusing,\r\nand gets in the way of a zero-configuration dashboard.\r\n\r\n## Solution:\r\n\r\nAdd `Administrate::BaseDashboard#display_resource`,\r\nwhich takes a resource and returns a sensible string representation.\r\nDevs can overwrite this method on a per-dashboard basis\r\nto customize how their resources are displayed.\r\n\r\nIn order to document this method,\r\nwe generate comments in each dashboard class that follow the format:\r\n\r\n```ruby\r\n  # Overwrite this method to customize how line items are displayed\r\n  # across all pages of the admin dashboard.\r\n  #\r\n  # def display_resource(line_item)\r\n  #   \"LineItem ##{line_item.id}\"\r\n  # end\r\n```\r\n\r\n## TODO\r\n\r\n- [x] Add comments to generated dashboards\r\n- [x] CHANGELOG","created_at":"2015-11-08T10:04:24Z","updated_at":"2015-11-12T05:22:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe0bf45c6218e22886094fda10973cf9b5efa97c","assignee":{"login":"graysonwright","id":829576,"avatar_url":"https://avatars.githubusercontent.com/u/829576?v=3","gravatar_id":"","url":"https://api.github.com/users/graysonwright","html_url":"https://github.com/graysonwright","followers_url":"https://api.github.com/users/graysonwright/followers","following_url":"https://api.github.com/users/graysonwright/following{/other_user}","gists_url":"https://api.github.com/users/graysonwright/gists{/gist_id}","starred_url":"https://api.github.com/users/graysonwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graysonwright/subscriptions","organizations_url":"https://api.github.com/users/graysonwright/orgs","repos_url":"https://api.github.com/users/graysonwright/repos","events_url":"https://api.github.com/users/graysonwright/events{/privacy}","received_events_url":"https://api.github.com/users/graysonwright/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/thoughtbot/administrate/milestones/1","html_url":"https://github.com/thoughtbot/administrate/milestones/0.1.1","labels_url":"https://api.github.com/repos/thoughtbot/administrate/milestones/1/labels","id":1391988,"number":1,"title":"0.1.1","description":"High-priority bugfixes and adjustments after inital launch.","creator":{"login":"graysonwright","id":829576,"avatar_url":"https://avatars.githubusercontent.com/u/829576?v=3","gravatar_id":"","url":"https://api.github.com/users/graysonwright","html_url":"https://github.com/graysonwright","followers_url":"https://api.github.com/users/graysonwright/followers","following_url":"https://api.github.com/users/graysonwright/following{/other_user}","gists_url":"https://api.github.com/users/graysonwright/gists{/gist_id}","starred_url":"https://api.github.com/users/graysonwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graysonwright/subscriptions","organizations_url":"https://api.github.com/users/graysonwright/orgs","repos_url":"https://api.github.com/users/graysonwright/repos","events_url":"https://api.github.com/users/graysonwright/events{/privacy}","received_events_url":"https://api.github.com/users/graysonwright/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":8,"state":"open","created_at":"2015-11-03T18:57:24Z","updated_at":"2015-11-12T02:35:31Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/191/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/191/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/issues/191/comments","statuses_url":"https://api.github.com/repos/thoughtbot/administrate/statuses/df6c1932bb8b7fd4b991b55eca13aeaef942f7ae","head":{"label":"thoughtbot:gw-display-resource","ref":"gw-display-resource","sha":"df6c1932bb8b7fd4b991b55eca13aeaef942f7ae","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","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":33739333,"name":"administrate","full_name":"thoughtbot/administrate","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","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/administrate","description":"A Rails engine that helps you put together a super-flexible admin dashboard.","fork":false,"url":"https://api.github.com/repos/thoughtbot/administrate","forks_url":"https://api.github.com/repos/thoughtbot/administrate/forks","keys_url":"https://api.github.com/repos/thoughtbot/administrate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/administrate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/administrate/teams","hooks_url":"https://api.github.com/repos/thoughtbot/administrate/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/administrate/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/administrate/events","assignees_url":"https://api.github.com/repos/thoughtbot/administrate/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/administrate/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/administrate/tags","blobs_url":"https://api.github.com/repos/thoughtbot/administrate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/administrate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/administrate/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/administrate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/administrate/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/administrate/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/administrate/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/administrate/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/administrate/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/administrate/subscription","commits_url":"https://api.github.com/repos/thoughtbot/administrate/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/administrate/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/administrate/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/administrate/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/administrate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/administrate/merges","archive_url":"https://api.github.com/repos/thoughtbot/administrate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/administrate/downloads","issues_url":"https://api.github.com/repos/thoughtbot/administrate/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/administrate/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/administrate/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/administrate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/administrate/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/administrate/releases{/id}","created_at":"2015-04-10T16:43:02Z","updated_at":"2015-11-12T05:01:28Z","pushed_at":"2015-11-12T05:10:58Z","git_url":"git://github.com/thoughtbot/administrate.git","ssh_url":"git@github.com:thoughtbot/administrate.git","clone_url":"https://github.com/thoughtbot/administrate.git","svn_url":"https://github.com/thoughtbot/administrate","homepage":"http://administrate-prototype.herokuapp.com/admin","size":3118,"stargazers_count":1529,"watchers_count":1529,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":50,"forks":63,"open_issues":50,"watchers":1529,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"661874408e4acf32574c375e0504b845052384c8","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","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":33739333,"name":"administrate","full_name":"thoughtbot/administrate","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","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/administrate","description":"A Rails engine that helps you put together a super-flexible admin dashboard.","fork":false,"url":"https://api.github.com/repos/thoughtbot/administrate","forks_url":"https://api.github.com/repos/thoughtbot/administrate/forks","keys_url":"https://api.github.com/repos/thoughtbot/administrate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/administrate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/administrate/teams","hooks_url":"https://api.github.com/repos/thoughtbot/administrate/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/administrate/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/administrate/events","assignees_url":"https://api.github.com/repos/thoughtbot/administrate/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/administrate/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/administrate/tags","blobs_url":"https://api.github.com/repos/thoughtbot/administrate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/administrate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/administrate/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/administrate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/administrate/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/administrate/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/administrate/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/administrate/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/administrate/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/administrate/subscription","commits_url":"https://api.github.com/repos/thoughtbot/administrate/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/administrate/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/administrate/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/administrate/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/administrate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/administrate/merges","archive_url":"https://api.github.com/repos/thoughtbot/administrate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/administrate/downloads","issues_url":"https://api.github.com/repos/thoughtbot/administrate/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/administrate/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/administrate/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/administrate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/administrate/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/administrate/releases{/id}","created_at":"2015-04-10T16:43:02Z","updated_at":"2015-11-12T05:01:28Z","pushed_at":"2015-11-12T05:10:58Z","git_url":"git://github.com/thoughtbot/administrate.git","ssh_url":"git@github.com:thoughtbot/administrate.git","clone_url":"https://github.com/thoughtbot/administrate.git","svn_url":"https://github.com/thoughtbot/administrate","homepage":"http://administrate-prototype.herokuapp.com/admin","size":3118,"stargazers_count":1529,"watchers_count":1529,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":50,"forks":63,"open_issues":50,"watchers":1529,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/191"},"html":{"href":"https://github.com/thoughtbot/administrate/pull/191"},"issue":{"href":"https://api.github.com/repos/thoughtbot/administrate/issues/191"},"comments":{"href":"https://api.github.com/repos/thoughtbot/administrate/issues/191/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/191/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/191/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/administrate/statuses/df6c1932bb8b7fd4b991b55eca13aeaef942f7ae"}}}}