{"id":2668,"date":"2019-08-04T23:34:34","date_gmt":"2019-08-04T14:34:34","guid":{"rendered":"http:\/\/www.cotegg.com\/blog\/?p=2668"},"modified":"2019-08-05T02:49:54","modified_gmt":"2019-08-04T17:49:54","slug":"rails-image_tag%e3%82%92%e4%bd%bf%e3%82%8f%e3%81%9a%e3%81%abassets%e5%86%85%e3%81%ae%e7%94%bb%e5%83%8f%e3%82%92%e6%8c%87%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.cotegg.com\/blog\/?p=2668","title":{"rendered":"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u3055\u3068\u3046\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fimage_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3067\u3059\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nimage_path(&quot;test.png&quot;)\r\n<\/pre>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b<code>image_path()<\/code> \u3092\u4f7f\u3048\u3070OK\u3067\u3059\uff01<\/p>\n<p><code>\/assets\/images\/test.png<\/code> \u306e\u3088\u3046\u306b\u76f4\u63a5\u6307\u5b9a\u3059\u308b\u306e\u306fNG\u3067\u3059\u3002<\/p>\n<h2>\u3082\u3046\u5c11\u3057\u8a73\u3057\u304f<\/h2>\n<p>\u307e\u305a\u3001Rails\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30cf\u30c3\u30b7\u30e5\u5024\u304c\u4ed8\u4e0e\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ntest-3e1de2bb6a447def67a92dedb2319d09211ea20b88b84dda2cef238180c69abc.png\r\n<\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u753b\u9762\u3067\u8868\u793a\u3059\u308b\u3068\u304d\u306b\u306f<code>image_tag<\/code> \u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n<code>image_tag<\/code> \u306f<code>&lt;img&gt;\u30bf\u30b0<\/code>\u306b\u753b\u50cfURL\u3092\u5165\u308c\u3066\u8868\u793a\u3057\u3066\u304f\u308c\u307e\u3059\u3002<br \/>\n\u3053\u306e\u3068\u304d\u306b<code>-3e1de2...<\/code> \u3068\u3044\u3046\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u6c17\u306b\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nimage_tag(&quot;test.png&quot;)\r\n# =&gt; &lt;img src=&quot;http:\/\/example.com\/assets\/test.png&quot;&gt;\r\n<\/pre>\n<p>\u305d\u3057\u3066\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f<code>image_path<\/code> \u306f\u753b\u50cf\u306e\u30d1\u30b9\u3060\u3051\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br \/>\n\u3082\u3061\u308d\u3093\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u6c17\u306b\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nimage_path(&quot;test.png&quot;)\r\n# =&gt; &quot;\/assets\/test.png&quot;\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>Rails\u3067\u306f\u76f4\u63a5<code>assets<\/code> \u304b\u3089\u306e\u30d1\u30b9\u3092\u66f8\u3044\u3066\u3082\u53cd\u6620\u3055\u308c\u307e\u305b\u3093\u3002<br \/>\n\u5fc5\u305a<a href=\"https:\/\/api.rubyonrails.org\/classes\/ActionView\/Helpers\/AssetUrlHelper.html\">ActionView::Helpers::AssetUrlHelper<\/a>\u3092\u4f7f\u3046\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002\u3068\u3044\u3046\u81ea\u5206\u3078\u306e\u6212\u3081\u3082\u542b\u3081\u3066\u8a18\u4e8b\u306b\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u3055\u3068\u3046\u3067\u3059\u3002 \u4eca\u56de\u306fimage_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf &#8230; <\/p>\n","protected":false},"author":12,"featured_media":2081,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[7],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.13 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5 | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cotegg.com\/blog\/?p=2668\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5 | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4\" \/>\n<meta property=\"og:description\" content=\"\u3053\u3093\u306b\u3061\u306f\u3002\u3055\u3068\u3046\u3067\u3059\u3002 \u4eca\u56de\u306fimage_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cotegg.com\/blog\/?p=2668\" \/>\n<meta property=\"og:site_name\" content=\"\u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/COTegg.japan\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-04T14:34:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-04T17:49:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2018\/12\/rails_logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"saton\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cotegg_japan\" \/>\n<meta name=\"twitter:site\" content=\"@cotegg_japan\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"saton\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=2668#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=2668\"},\"author\":{\"name\":\"saton\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/93ca0e749253dcd8fc2c4cd8dd5c6a1f\"},\"headline\":\"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\",\"datePublished\":\"2019-08-04T14:34:34+00:00\",\"dateModified\":\"2019-08-04T17:49:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=2668\"},\"wordCount\":77,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/#organization\"},\"articleSection\":[\"\u6280\u8853\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.cotegg.com\/blog\/?p=2668#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=2668\",\"url\":\"https:\/\/www.cotegg.com\/blog\/?p=2668\",\"name\":\"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5 | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4\",\"isPartOf\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/#website\"},\"datePublished\":\"2019-08-04T14:34:34+00:00\",\"dateModified\":\"2019-08-04T17:49:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=2668#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.cotegg.com\/blog\/?p=2668\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=2668#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.cotegg.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#website\",\"url\":\"https:\/\/www.cotegg.com\/blog\/\",\"name\":\"COTegg\u306e\u30d0\u30b1\u30c4\",\"description\":\"- Bucket of cotegg -\",\"publisher\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.cotegg.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#organization\",\"name\":\"COTegg Inc.\",\"url\":\"https:\/\/www.cotegg.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2015\/07\/logo_color1_yoko-e1436354651882.png\",\"contentUrl\":\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2015\/07\/logo_color1_yoko-e1436354651882.png\",\"width\":176,\"height\":60,\"caption\":\"COTegg Inc.\"},\"image\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/COTegg.japan\/\",\"https:\/\/twitter.com\/cotegg_japan\",\"https:\/\/www.instagram.com\/cotegg_japan\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/93ca0e749253dcd8fc2c4cd8dd5c6a1f\",\"name\":\"saton\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6a05e1ac3be4a1ef1348bf2b203cfce7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6a05e1ac3be4a1ef1348bf2b203cfce7?s=96&d=mm&r=g\",\"caption\":\"saton\"},\"url\":\"https:\/\/www.cotegg.com\/blog\/?author=12\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5 | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cotegg.com\/blog\/?p=2668","og_locale":"ja_JP","og_type":"article","og_title":"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5 | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4","og_description":"\u3053\u3093\u306b\u3061\u306f\u3002\u3055\u3068\u3046\u3067\u3059\u3002 \u4eca\u56de\u306fimage_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf ...","og_url":"https:\/\/www.cotegg.com\/blog\/?p=2668","og_site_name":"\u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4","article_publisher":"https:\/\/www.facebook.com\/COTegg.japan\/","article_published_time":"2019-08-04T14:34:34+00:00","article_modified_time":"2019-08-04T17:49:54+00:00","og_image":[{"width":300,"height":300,"url":"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2018\/12\/rails_logo.png","type":"image\/png"}],"author":"saton","twitter_card":"summary_large_image","twitter_creator":"@cotegg_japan","twitter_site":"@cotegg_japan","twitter_misc":{"\u57f7\u7b46\u8005":"saton"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cotegg.com\/blog\/?p=2668#article","isPartOf":{"@id":"https:\/\/www.cotegg.com\/blog\/?p=2668"},"author":{"name":"saton","@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/93ca0e749253dcd8fc2c4cd8dd5c6a1f"},"headline":"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5","datePublished":"2019-08-04T14:34:34+00:00","dateModified":"2019-08-04T17:49:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cotegg.com\/blog\/?p=2668"},"wordCount":77,"commentCount":0,"publisher":{"@id":"https:\/\/www.cotegg.com\/blog\/#organization"},"articleSection":["\u6280\u8853"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.cotegg.com\/blog\/?p=2668#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.cotegg.com\/blog\/?p=2668","url":"https:\/\/www.cotegg.com\/blog\/?p=2668","name":"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5 | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4","isPartOf":{"@id":"https:\/\/www.cotegg.com\/blog\/#website"},"datePublished":"2019-08-04T14:34:34+00:00","dateModified":"2019-08-04T17:49:54+00:00","breadcrumb":{"@id":"https:\/\/www.cotegg.com\/blog\/?p=2668#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cotegg.com\/blog\/?p=2668"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.cotegg.com\/blog\/?p=2668#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cotegg.com\/blog"},{"@type":"ListItem","position":2,"name":"[Rails] image_tag\u3092\u4f7f\u308f\u305a\u306bassets\u5185\u306e\u753b\u50cf\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.cotegg.com\/blog\/#website","url":"https:\/\/www.cotegg.com\/blog\/","name":"COTegg\u306e\u30d0\u30b1\u30c4","description":"- Bucket of cotegg -","publisher":{"@id":"https:\/\/www.cotegg.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cotegg.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.cotegg.com\/blog\/#organization","name":"COTegg Inc.","url":"https:\/\/www.cotegg.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2015\/07\/logo_color1_yoko-e1436354651882.png","contentUrl":"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2015\/07\/logo_color1_yoko-e1436354651882.png","width":176,"height":60,"caption":"COTegg Inc."},"image":{"@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/COTegg.japan\/","https:\/\/twitter.com\/cotegg_japan","https:\/\/www.instagram.com\/cotegg_japan\/"]},{"@type":"Person","@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/93ca0e749253dcd8fc2c4cd8dd5c6a1f","name":"saton","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6a05e1ac3be4a1ef1348bf2b203cfce7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6a05e1ac3be4a1ef1348bf2b203cfce7?s=96&d=mm&r=g","caption":"saton"},"url":"https:\/\/www.cotegg.com\/blog\/?author=12"}]}},"_links":{"self":[{"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2668"}],"collection":[{"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2668"}],"version-history":[{"count":10,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2668\/revisions"}],"predecessor-version":[{"id":2678,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2668\/revisions\/2678"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/2081"}],"wp:attachment":[{"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}