{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments/48428183","id":48428183,"diff_hunk":"@@ -16,5 +16,21 @@ def display_resource_name(resource_name)\n           default: resource_name.to_s.pluralize.titleize,\n         )\n     end\n+\n+    def svg_tag(asset, options = {})\n+      svg_id = options.fetch(:svg_id)\n+\n+      svg_attributes = {\n+        \"xlink:href\" => \"#{asset_url(asset)}##{svg_id}\"\n+      }\n+      svg_attributes[:width] = options[:width] if options[:width]\n+      svg_attributes[:height] = options[:height] if options[:height]\n+\n+      content_tag :svg,\n+        xmlns: 'http://www.w3.org/2000/svg'.freeze,","path":"app/helpers/administrate/application_helper.rb","position":15,"original_position":15,"commit_id":"ad0924e1a3e4058a7764de21f0e57e5a33462e88","original_commit_id":"ad0924e1a3e4058a7764de21f0e57e5a33462e88","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Align the parameters of a method call if they span more than one line.<br>Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-12-25T00:54:35Z","updated_at":"2015-12-25T00:54:35Z","html_url":"https://github.com/thoughtbot/administrate/pull/365#discussion_r48428183","pull_request_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/365","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments/48428183"},"html":{"href":"https://github.com/thoughtbot/administrate/pull/365#discussion_r48428183"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/365"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/administrate/pulls/365","id":54569379,"html_url":"https://github.com/thoughtbot/administrate/pull/365","diff_url":"https://github.com/thoughtbot/administrate/pull/365.diff","patch_url":"https://github.com/thoughtbot/administrate/pull/365.patch","issue_url":"https://api.github.com/repos/thoughtbot/administrate/issues/365","number":365,"state":"open","locked":false,"title":"Removes inline_svg dependency.","user":{"login":"mariochavez","id":59967,"avatar_url":"https://avatars.githubusercontent.com/u/59967?v=3","gravatar_id":"","url":"https://api.github.com/users/mariochavez","html_url":"https://github.com/mariochavez","followers_url":"https://api.github.com/users/mariochavez/followers","following_url":"https://api.github.com/users/mariochavez/following{/other_user}","gists_url":"https://api.github.com/users/mariochavez/gists{/gist_id}","starred_url":"https://api.github.com/users/mariochavez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariochavez/subscriptions","organizations_url":"https://api.github.com/users/mariochavez/orgs","repos_url":"https://api.github.com/users/mariochavez/repos","events_url":"https://api.github.com/users/mariochavez/events{/privacy}","received_events_url":"https://api.github.com/users/mariochavez/received_events","type":"User","site_admin":false},"body":"inline_svg gem is currently broken to work with Sprockets 3 and the Rails\r\napplication environment set to production. So this has broken administrate as\r\nwell. Normally a fix should be implemented in broken gem but after looking at\r\nwhy administrate requires inline_svg gem I realize that it is easy to replace\r\nit with a helper method.\r\n\r\nApplicationHelper#svg_tag method was added to substitute the work of\r\ninline_svg. This method creates a svg tag that will look like:\r\n\r\n    <svg xmlns=\"http://www.w3.org/2000/svg\"\r\n    xmlns:xlink=\"http://www.w3.org/1999/xlink\"><use\r\n    xlink:href=\"http://localhost:3000/assets/administrate/search-360c782d91a21edd53f5754c3fd8f8984ec5d9b36389f6df1fe618a4e50405b6.svg#search\" width=\"16\" height=\"16\"></use></svg>\r\n\r\nThis will allow to resize the svg image and to use css to change properties\r\nlike color.\r\n\r\nBut there are a couple of differences with inline_svg. First the svg file\r\nshould have an id property, for my previous example it is `search`.\r\n\r\nThe second difference is that `use` tag needs to have `height` and `width`\r\nproperties set as attributes of the tag, css properties will not affect the svg\r\nsize.\r\n\r\nApplicationHelper#svg_tag used to generate html shown above looks like:\r\n\r\n```\r\n<%= svg_tag \"administrate/search.svg\",\r\n  svg_id: \"search\", width: \"16\", height: \"16\" %>\r\n```\r\n\r\nThis solution will play nice with Sprockets and with modern browsers.","created_at":"2015-12-25T00:54:19Z","updated_at":"2015-12-25T00:54:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a43d1bcc7926202f25065274e01945078c3ccf8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/365/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/365/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/issues/365/comments","statuses_url":"https://api.github.com/repos/thoughtbot/administrate/statuses/ad0924e1a3e4058a7764de21f0e57e5a33462e88","head":{"label":"mariochavez:remove-inline_svg","ref":"remove-inline_svg","sha":"ad0924e1a3e4058a7764de21f0e57e5a33462e88","user":{"login":"mariochavez","id":59967,"avatar_url":"https://avatars.githubusercontent.com/u/59967?v=3","gravatar_id":"","url":"https://api.github.com/users/mariochavez","html_url":"https://github.com/mariochavez","followers_url":"https://api.github.com/users/mariochavez/followers","following_url":"https://api.github.com/users/mariochavez/following{/other_user}","gists_url":"https://api.github.com/users/mariochavez/gists{/gist_id}","starred_url":"https://api.github.com/users/mariochavez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariochavez/subscriptions","organizations_url":"https://api.github.com/users/mariochavez/orgs","repos_url":"https://api.github.com/users/mariochavez/repos","events_url":"https://api.github.com/users/mariochavez/events{/privacy}","received_events_url":"https://api.github.com/users/mariochavez/received_events","type":"User","site_admin":false},"repo":{"id":46837087,"name":"administrate","full_name":"mariochavez/administrate","owner":{"login":"mariochavez","id":59967,"avatar_url":"https://avatars.githubusercontent.com/u/59967?v=3","gravatar_id":"","url":"https://api.github.com/users/mariochavez","html_url":"https://github.com/mariochavez","followers_url":"https://api.github.com/users/mariochavez/followers","following_url":"https://api.github.com/users/mariochavez/following{/other_user}","gists_url":"https://api.github.com/users/mariochavez/gists{/gist_id}","starred_url":"https://api.github.com/users/mariochavez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariochavez/subscriptions","organizations_url":"https://api.github.com/users/mariochavez/orgs","repos_url":"https://api.github.com/users/mariochavez/repos","events_url":"https://api.github.com/users/mariochavez/events{/privacy}","received_events_url":"https://api.github.com/users/mariochavez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mariochavez/administrate","description":"A Rails engine that helps you put together a super-flexible admin dashboard.","fork":true,"url":"https://api.github.com/repos/mariochavez/administrate","forks_url":"https://api.github.com/repos/mariochavez/administrate/forks","keys_url":"https://api.github.com/repos/mariochavez/administrate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mariochavez/administrate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mariochavez/administrate/teams","hooks_url":"https://api.github.com/repos/mariochavez/administrate/hooks","issue_events_url":"https://api.github.com/repos/mariochavez/administrate/issues/events{/number}","events_url":"https://api.github.com/repos/mariochavez/administrate/events","assignees_url":"https://api.github.com/repos/mariochavez/administrate/assignees{/user}","branches_url":"https://api.github.com/repos/mariochavez/administrate/branches{/branch}","tags_url":"https://api.github.com/repos/mariochavez/administrate/tags","blobs_url":"https://api.github.com/repos/mariochavez/administrate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mariochavez/administrate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mariochavez/administrate/git/refs{/sha}","trees_url":"https://api.github.com/repos/mariochavez/administrate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mariochavez/administrate/statuses/{sha}","languages_url":"https://api.github.com/repos/mariochavez/administrate/languages","stargazers_url":"https://api.github.com/repos/mariochavez/administrate/stargazers","contributors_url":"https://api.github.com/repos/mariochavez/administrate/contributors","subscribers_url":"https://api.github.com/repos/mariochavez/administrate/subscribers","subscription_url":"https://api.github.com/repos/mariochavez/administrate/subscription","commits_url":"https://api.github.com/repos/mariochavez/administrate/commits{/sha}","git_commits_url":"https://api.github.com/repos/mariochavez/administrate/git/commits{/sha}","comments_url":"https://api.github.com/repos/mariochavez/administrate/comments{/number}","issue_comment_url":"https://api.github.com/repos/mariochavez/administrate/issues/comments{/number}","contents_url":"https://api.github.com/repos/mariochavez/administrate/contents/{+path}","compare_url":"https://api.github.com/repos/mariochavez/administrate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mariochavez/administrate/merges","archive_url":"https://api.github.com/repos/mariochavez/administrate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mariochavez/administrate/downloads","issues_url":"https://api.github.com/repos/mariochavez/administrate/issues{/number}","pulls_url":"https://api.github.com/repos/mariochavez/administrate/pulls{/number}","milestones_url":"https://api.github.com/repos/mariochavez/administrate/milestones{/number}","notifications_url":"https://api.github.com/repos/mariochavez/administrate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mariochavez/administrate/labels{/name}","releases_url":"https://api.github.com/repos/mariochavez/administrate/releases{/id}","created_at":"2015-11-25T04:19:33Z","updated_at":"2015-11-25T04:19:33Z","pushed_at":"2015-12-25T00:52:58Z","git_url":"git://github.com/mariochavez/administrate.git","ssh_url":"git@github.com:mariochavez/administrate.git","clone_url":"https://github.com/mariochavez/administrate.git","svn_url":"https://github.com/mariochavez/administrate","homepage":"http://administrate-prototype.herokuapp.com/admin","size":541,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"thoughtbot:master","ref":"master","sha":"4eede3b15df668e3913e7edd3a018eb97dc28aa8","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-12-24T23:53:01Z","pushed_at":"2015-12-25T00:54:20Z","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":866,"stargazers_count":1958,"watchers_count":1958,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":122,"mirror_url":null,"open_issues_count":72,"forks":122,"open_issues":72,"watchers":1958,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/365"},"html":{"href":"https://github.com/thoughtbot/administrate/pull/365"},"issue":{"href":"https://api.github.com/repos/thoughtbot/administrate/issues/365"},"comments":{"href":"https://api.github.com/repos/thoughtbot/administrate/issues/365/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/365/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/365/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/administrate/statuses/ad0924e1a3e4058a7764de21f0e57e5a33462e88"}}}}