{"id":11363,"date":"2020-07-18T09:29:25","date_gmt":"2020-07-18T00:29:25","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=11363"},"modified":"2023-05-27T22:47:32","modified_gmt":"2023-05-27T13:47:32","slug":"%e3%80%90ruby-on-rails%e3%80%91%e3%80%8caction-text%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=11363","title":{"rendered":"\u3010Ruby on Rails\u3011\u300cAction Text\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>Action Text\u3068\u306f\uff1f<\/h2>\n<p>Rails6\u304b\u3089\u767b\u5834\u3057\u305f\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<pre class=\"lang:default decode:true \">rails action_text:install<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u4e0b\u8a18\u306e\u8a18\u8ff0\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>app\/javascript\/packs<\/h3>\n<pre class=\"lang:default decode:true\">require(\"trix\")\r\nrequire(\"@rails\/actiontext\")<\/pre>\n<h4>trix<\/h4>\n<p>WYSIWYG\u3092\u5b9f\u73fe\u3059\u308b\u30ea\u30c3\u30c1\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb<\/h3>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306bActionText\u3092\u5b9f\u88c5\u3059\u308b\u4e0a\u3067\u5fc5\u9808\u306e3\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002\u4e0b\u8a18\u306e\u30c6\u30fc\u30d6\u30eb\u306bWYSIWYG\u30c7\u30fc\u30bf\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/p>\n<div>\n<ul>\n<li>active_storage_blobs<\/li>\n<li>\n<div>\n<div>active_storage_attachments<\/div>\n<div>\n<div>\n<div>action_text_rich_texts<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<h4>action_text_rich_texts<\/h4>\n<p>\u30a2\u30af\u30b7\u30e7\u30f3\u30c6\u30ad\u30b9\u30c8\u30ea\u30c3\u30c1\u30c6\u30ad\u30b9\u30c8\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>has_rich_text<\/strong><\/span>\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u306b\u3088\u3063\u3066<span style=\"color: #ff0000;\"><strong>\u81ea\u5206\u305f\u3061\u304c\u7528\u610f\u3057\u305f\u30c7\u30fc\u30bf\u767b\u9332\u7528\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u7d10\u3065\u3051\u308b<\/strong><\/span>\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u901a\u5e38\u306e\u95a2\u9023\u3065\u3051\u3067\u3042\u308c\u3070\u95a2\u9023\u3065\u3051\u308b\u5148\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5358\u6570\u578b\u306bid\u3092\u3064\u3051\u305f(user_id\u7b49)\u304c\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u95a2\u9023\u3065\u3051\u306f\u4e0b\u8a182\u3064\u306e\u30ab\u30e9\u30e0\u306e\u5024\u3067\u95a2\u9023\u3065\u3051\u3092\u52d5\u7684\u306b\u884c\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u8907\u6570\u306e\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u306e\u95a2\u9023\u3065\u3051\u3092\u5c11\u306a\u3044\u30b3\u30fc\u30c9\u306e\u8a18\u8ff0\u3067\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308b\u306e\u3067\u3059\u3002\u3053\u308c\u3092<span style=\"color: #ff0000;\"><strong>\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30c3\u30af\u30a2\u30bd\u30b7\u30a8\u30fc\u30b7\u30e7\u30f3<\/strong><\/span>\u3068\u547c\u3073\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">    t.string \"record_type\", null: false\r\n    t.bigint \"record_id\", null: false<\/pre>\n<h4>active_storage_attachments<\/h4>\n<p>\u591a\uff1a\u591a\u306e\u95a2\u9023\u3065\u3051\u306e\u4ef2\u4ecb\u3092\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002action_text_rich_texts\u30c6\u30fc\u30d6\u30eb\u3068action_storage_blobs\u306e\u305d\u308c\u305e\u308c\u306b\u95a2\u9023\u3065\u3044\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u3082\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30c3\u30af\u30a2\u30bd\u30b7\u30a8\u30fc\u30b7\u30e7\u30f3\u3067\u95a2\u9023\u3065\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4>active_storage_blobs<\/h4>\n<p>\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u7b49\u306e\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u683c\u7d0d\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002<\/p>\n<h3>CSS<\/h3>\n<div>\n<div>app\/assets\/stylesheets\u306b\u300cactiontext.scss\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u3066.trix-content\u3068\u3044\u3046trix\u306e\u30af\u30e9\u30b9\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/div>\n<\/div>\n<h3>views<\/h3>\n<p>\u300capp\/views\/active_storage\/blobs\u300d\u306b<span style=\"color: #ff0000;\"><strong>\u300c_blob.html.erb\u300d<\/strong><\/span>\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002Trix\u30a8\u30c7\u30a3\u30bf\u3067\u306f\u753b\u50cf\u3092\u30c9\u30e9\u30c3\u30b0\u30a2\u30f3\u30c9\u30c9\u30ed\u30c3\u30d7\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3067\u304d\u307e\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u753b\u50cf\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u969b\u306b\u4f7f\u7528\u3055\u308c\u308berb<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>image_processing\u306e\u5c0e\u5165<\/h2>\n<p>actionText\u3092\u5c0e\u5165\u3059\u308b\u969b\u306b\u5fc5\u9808\u3068\u306a\u308bGem\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3057\u3066<span style=\"color: #ff0000;\"><strong>\u300cimage_processing\u300d<\/strong><\/span>\u304c\u3042\u308a\u307e\u3059\u3002Gemfile\u3092\u958b\u3044\u305f\u969b\u306b\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u308b\u4e0b\u8a18\u306e\u884c\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u89e3\u9664\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true  \"># Use Active Storage variant\r\ngem 'image_processing', '~&gt; 1.2'<\/pre>\n","protected":false},"excerpt":{"rendered":"Action Text\u3068\u306f\uff1f Rails6\u304b\u3089\u767b\u5834\u3057\u305f\u6a5f\u80fd\u3067\u3059\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb rails action_text:install \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u4e0b\u8a18\u306e\u8a18\u8ff0\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002 app\/javascript\/packs  [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[36],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/11363"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11363"}],"version-history":[{"count":11,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/11363\/revisions"}],"predecessor-version":[{"id":20511,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/11363\/revisions\/20511"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11363"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}