{"id":6691,"date":"2016-02-20T13:41:57","date_gmt":"2016-02-20T04:41:57","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=6691"},"modified":"2016-02-20T19:31:54","modified_gmt":"2016-02-20T10:31:54","slug":"rails4-typescript-angularjs-slim%e3%81%a7-%e5%bf%ab%e9%81%a9%e9%96%8b%e7%99%ba%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89%ef%bc%81%e6%9c%80%e7%9f%ad%e3%81%a7%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=6691","title":{"rendered":"Rails4 + TypeScript + AngularJS + slim\u3067 \u5feb\u9069\u958b\u767a\u74b0\u5883\u69cb\u7bc9\uff01\u6700\u77ed\u3067SPA\u74b0\u5883\u4f5c\u6210\u3002"},"content":{"rendered":"<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/railstop.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/railstop.png\" alt=\"railstop\" width=\"670\" height=\"277\" class=\"alignnone size-full wp-image-6693\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/railstop.png 670w, https:\/\/www.webcyou.com\/wp-content\/uploads\/railstop-300x124.png 300w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/a><\/p>\n<p>\u6700\u8fd1\u306f\u4f55\u304b\u3068\u3001iphone\u30a2\u30d7\u30ea\u306b\u306f\u307e\u3063\u3066\u307e\u3057\u3066\u3001\u4e45\u3005\u306bweb\u306e\u65b9\u3082\u66f8\u3053\u3046\u304b\u3068\u3002<\/p>\n<p>\u3044\u3084\u3041\u3002\u3057\u304b\u3057Rails\u306f\u4fbf\u5229\u3067\u3059\u306d\u3002<\/p>\n<p>\u4f55\u304b\u3068\u8a71\u984c\u306e<strong>Ruby on Rails\u3002<\/strong><\/p>\n<p>Ruby on Rails\u3092\u5229\u7528\u3059\u308b\u3068\u3001\u30b5\u30af\u30c3\u3068\u3001DB\u3084\u3001web\u30b5\u30fc\u30d3\u30b9\u3082\u4f5c\u308c\u308b\u3057\u3001\u524d\u306b\u6bd4\u3079\u308b\u3068web\u30b5\u30fc\u30d3\u30b9\u306a\u3069\u306e\u5236\u4f5c\u306e\u6577\u5c45\u3082\u4e0b\u304c\u3063\u305f\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u3002<\/p>\n<p>\u3057\u304b\u3057\u306a\u304c\u3089\u3001Ruby on Rails\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u7528\u610f\u3055\u308c\u305f\u3001view helper\u3084coffeescript\u3067\u30d5\u30ed\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u3069\u3046\u3082\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306aUI\u3092\u4f5c\u308d\u3046\u3068\u3057\u3066\u3082\u3001\u52b9\u7387\u304c\u60aa\u304b\u3063\u305f\u308a\u3001\u3084\u3084\u5f37\u5f15\u306a\u8a2d\u8a08\u306b\u306a\u3063\u305f\u308a\u3057\u307e\u305b\u3093\u304b\u3002<\/p>\n<p>\u3068\u3044\u3046\u4e8b\u3067\u3001<strong>Rails\u306b\u306fAPI\u3092\u8fd4\u3059\u3060\u3051<\/strong>\uff08\u6975\u7aef\u306b\u8a00\u3046\u3068\uff09\u306b\u3057\u3001<strong>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\uff08view\u306e\u4f5c\u6210\uff09\u306fAngularJS\u3092\u7528\u3044\u3066SPA\u5316\u3057\u3001TypeScript\u3067\u3088\u308a\u4fdd\u5b88\u6027\u3092\u9ad8\u3081<\/strong>\u5feb\u9069\u306a\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3088\u3046\u3067\u306f\u306a\u3044\u3067\u3059\u304b\u3002<\/p>\n<p>\uff08\u4f55\u304b\u3068\u3001TypeScript +AngularJS\u304c\u9244\u677f\u5316\u3057\u3066\u6765\u3066\u308b\u611f\u3058\u3002\uff09<\/p>\n<p>\u3068\u3044\u3063\u305f\u611f\u3058\u3067\u3001\u56f3\u3067\u66f8\u304f\u3068\u4ee5\u4e0b\u306e\u69d8\u306a\u8a2d\u8a08\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u3046\u306a\u3063\u3066\u3044\u308b\u306e\u3092<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/aaa2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/aaa2.png\" alt=\"aaa\" width=\"293\" height=\"433\" class=\"alignnone  wp-image-6694\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/aaa2.png 420w, https:\/\/www.webcyou.com\/wp-content\/uploads\/aaa2-203x300.png 203w\" sizes=\"auto, (max-width: 293px) 100vw, 293px\" \/><\/a><\/p>\n<p>\u65b0\u305f\u306b\u3053\u3046\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mv.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mv.png\" alt=\"mv\" width=\"598\" height=\"405\" class=\"alignnone  wp-image-6695\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mv.png 924w, https:\/\/www.webcyou.com\/wp-content\/uploads\/mv-300x204.png 300w, https:\/\/www.webcyou.com\/wp-content\/uploads\/mv-900x611.png 900w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h5>\u958b\u767a\u74b0\u5883<\/h5>\n<p>Rails 4.2.4<\/p>\n<p>angularjs-rails\u00a01.4.8<\/p>\n<p>typescript-rails 0.5.0<\/p>\n<p>slim-rails 3.0.1<\/p>\n<p>&nbsp;<\/p>\n<h4>TypeScript<\/h4>\n<p>\u307e\u305a\u6700\u521d\u306bTypeScript\u3002<\/p>\n<p>TypeScript\u306f\u6240\u8b02\u3001AltJS\u306e\u4e00\u3064\u3067\u30012016\u5e74\u306eAltJS\u30c8\u30ec\u30f3\u30c9\u30e9\u30f3\u30ad\u30f3\u30b0\u3067\u3076\u3063\u3061\u304e\u308a\u306e1\u4f4d\u3092\u9032\u3093\u3067\u3044\u307e\u3059\u306e\u3067\u3001\u591a\u304f\u306e\u65b9\u304c\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/9c52a2107e3636b1fa6f963539f004a7.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/9c52a2107e3636b1fa6f963539f004a7.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2016-02-20 14.17.50\" width=\"632\" height=\"318\" class=\"alignnone size-full wp-image-6702\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/9c52a2107e3636b1fa6f963539f004a7.png 632w, https:\/\/www.webcyou.com\/wp-content\/uploads\/9c52a2107e3636b1fa6f963539f004a7-300x151.png 300w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/a><\/p>\n<p><strong>\u53c2\u8003URL<\/strong><\/p>\n<p><a href=\"http:\/\/www.buildinsider.net\/web\/popularjslib\/2016\">http:\/\/www.buildinsider.net\/web\/popularjslib\/2016<\/a><\/p>\n<p><strong>Rails\u3067\u3082TypeScript\u3092\u4f7f\u3044\u305f\u3044\uff01\uff01<\/strong><\/p>\n<p>TypeScript\u306b\u6163\u308c\u3066\u3044\u308b\u65b9\u306f\u3084\u306f\u308a\u305d\u3046\u601d\u3044\u307e\u3059\u3088\u306d\u3002\u3002<\/p>\n<p>\u5b89\u5fc3\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5c65\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>typescript-rails<\/strong>\u306a\u308b\u3082\u306e\u304c\u304d\u3061\u3093\u3068\u3042\u308a\u307e\u3059\u306e\u3067\u3001Ruby on Rails\u3067\u3082\u554f\u984c\u306a\u304f\u3001TypeScript\u306f\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p><strong>github<\/strong><\/p>\n<p><a href=\"https:\/\/github.com\/typescript-ruby\/typescript-rails\">https:\/\/github.com\/typescript-ruby\/typescript-rails<\/a><\/p>\n<p>\u65e5\u672c\u4eba\u306eFUJI Goro\u3055\u3093\u304c\u30e1\u30f3\u30c6\u30ca\u30fc\u3068\u3057\u3066\u6d3b\u52d5\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u662f\u975e\u9811\u5f35\u3063\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u3067\u3059\uff1e\uff1c<\/p>\n<p>\u3053\u3061\u3089\u3092gemfile\u306b\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">gem 'typescript-rails' '~&gt; 0.5.0'<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">bundle install<\/pre>\n<h5>\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210<\/h5>\n<p>TypeScript\u306e\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\u306b\u95a2\u3057\u3066\u306f\u3001<strong>\u300c\u25ef\u25ef.js.ts\u30d5\u30a1\u30a4\u30eb\u300d<\/strong>\u3092\u4f5c\u6210\u3059\u308b\u4e8b\u306b\u3088\u3063\u3066ts\u30d5\u30a1\u30a4\u30eb\u304c\u81ea\u52d5\u3067\u8aad\u307f\u8fbc\u307e\u308c\u3001JavaScript\u30d5\u30a1\u30a4\u30eb\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><strong>app\/assets\/javascripts\/\u25ef\u25ef.js.ts<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">module Hoge {\r\n    class HogeModel {\r\n        public hoge:string = \"hoge\";\r\n    }\r\n}<\/pre>\n<p>rails s \u3067\u3001rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3059\u308b\u3068JavaScript\u30d5\u30a1\u30a4\u30eb\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u5f8c<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">var Hoge;\r\n(function (Hoge) {\r\n    var HogeModel = (function () {\r\n        function HogeModel() {\r\n            this.hoge = \"hoge\";\r\n        }\r\n        return HogeModel;\r\n    })();\r\n})(Hoge || (Hoge = {}));<\/pre>\n<p>\u8a00\u3046\u307e\u3067\u3082\u306a\u3044\u304b\u3082\u77e5\u308c\u307e\u305b\u3093\u304c\u3001TypeScript\u306f\u9759\u7684\u578b\u4ed8\u3051\u8a00\u8a9e\u3067\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001<strong>\u5b9a\u7fa9\u306a\u3057\u306e\u305d\u306e\u4ed6\u306eJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u7b49\u3092TypeScript\u5185\u3067\u5229\u7528\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u304c\u767a\u751f<\/strong>\u3057\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3092\u884c\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u969b\u306f\u3001\u4ee5\u4e0b\u304b\u3089\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u9069\u3057\u305f\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u5927\u6982\u306e\u3082\u306e\u306f\u3053\u3061\u3089\u3067\u63c3\u3044\u307e\u3059\u3002<\/p>\n<p><strong>github<\/strong><\/p>\n<p><a href=\"https:\/\/github.com\/DefinitelyTyped\/DefinitelyTyped\" target=\"_blank\">https:\/\/github.com\/DefinitelyTyped\/DefinitelyTyped<\/a><\/p>\n<p>jquery\u3092\u4f7f\u304a\u3046\u3068\u3057\u3066\u3082\u3001\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u306a\u3044\u72b6\u614b\u3060\u3068\u30a8\u30e9\u30fc\u3067\u753b\u9762\u3059\u3089\u3082\u8868\u793a\u3057\u3066\u304f\u308c\u307e\u305b\u3093\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>reference path\u306b\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/\/\/ &lt;reference path=&quot;typings\/jquery.d.ts&quot; \/&gt;<\/pre>\n<p>\u3053\u308c\u3067\u3001reference path\u3092\u8ffd\u52a0\u3057\u305f\u3001TypeScript\u5185\u3067jquery\u3082\u5229\u7528\u3067\u304d\u308b\u69d8\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>TypeScript\u3092\u7528\u3044\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u524d\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u306e\u3067\u3001\u3088\u308a\u5f37\u56fa\u306a\u30d5\u30ed\u30f3\u30c8\u3068\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u9ad8\u3081\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>AngularJS<\/h4>\n<p>\u3053\u3061\u3089\u3082\u8aac\u660e\u306f\u4e0d\u8981\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001AngularJS\u306fMVVM\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3053\u3061\u3089\u3082\u3001\u30c8\u30ec\u30f3\u30c9\u30e9\u30f3\u30ad\u30f3\u30b0\u3067\u3076\u3063\u3061\u304e\u308a\u306e1\u4f4d\u3092\u9032\u3093\u3067\u3044\u307e\u3059\u306e\u3067\u3001\u591a\u304f\u306e\u65b9\u304c\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3057\u3087\u3046\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/45e4241b850622ab98f24c83236efd99.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/45e4241b850622ab98f24c83236efd99.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2016-02-20 14.21.21\" width=\"625\" height=\"347\" class=\"alignnone size-full wp-image-6703\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/45e4241b850622ab98f24c83236efd99.png 625w, https:\/\/www.webcyou.com\/wp-content\/uploads\/45e4241b850622ab98f24c83236efd99-300x167.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p><strong>\u53c2\u8003URL<\/strong><\/p>\n<p><a href=\"http:\/\/www.buildinsider.net\/web\/popularjslib\/2016\">http:\/\/www.buildinsider.net\/web\/popularjslib\/2016<\/a><\/p>\n<p>AngularJS\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f32\u3082\u30d9\u30fc\u30bf\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u914d\u5e03\u3055\u308c\u3066\u3044\u3066\u3001\u305d\u3061\u3089\u3092\u4f7f\u3063\u3066\u3082\u826f\u3044\u306e\u3067\u3059\u304c\u3001\u4eca\u307e\u3067\u3068\u306f\u8a18\u8ff0\u306a\u3069\u5168\u304f\u7570\u306a\u308a\u3001\u5225\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u306a\u3063\u3066\u3044\u308b\u5370\u8c61\u3042\u308a\u306a\u306e\u3067\u30011.4.8\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u8fd1\u30011.5\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u3068\u308a\u3042\u3048\u305a1.4.8\u3067\u3002<\/p>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u8aad\u307f\u8fbc\u3080\u306e\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001Rails way\u306e\u6cbf\u3063\u3066\u3001\u3053\u3061\u3089\u3082Gemfile\u306b\u8ffd\u52a0\u3059\u308b\u306e\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">gem 'angularjs-rails'<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">bundle install<\/pre>\n<p>app\/assets\/javascripts\/application.js \u306brequire\u3067\u8ffd\u52a0\u3002<\/p>\n<p><strong>app\/assets\/javascripts\/application.js<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/\/= require angular<\/pre>\n<p>&nbsp;<\/p>\n<p>rails s \u3067rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3002<\/p>\n<p><strong>\u3053\u308c\u3067\u3082\u3046AngularJS\u304c\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/strong><\/p>\n<p>Rails\u3060\u304b\u3089\u8a18\u8ff0\u304c\u7570\u306a\u308b\u3002\u3063\u3066\u4e8b\u306f\u7121\u3044\u306e\u3067\u3059\u304c\u3001view\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b<strong>\u300cHaml\u300d\u3084\u300cSlim\u300d<\/strong>\u306a\u3069\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u3068\u8a18\u8ff0\u306e\u4ed5\u65b9\u306b\u6238\u60d1\u3044\u307e\u3059\u3088\u306d\u3002\uff08\u81ea\u5206\u3060\u3051\u304b\u306a\uff09<\/p>\n<p><strong>haml<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">%div{'ng-controller' =&gt; 'MainCtrl'}\r\n  %ul\r\n    %li{'ng-repeat' =&gt; 'item in items track by $index'}\r\n      {{item}}<\/pre>\n<p><strong>slim<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">div ng-controller = 'MainCtrl'\r\n  ul\r\n    li ng-repeat = 'item in items track by $index'\r\n      | {{item}}<\/pre>\n<p>\u305d\u3046\u3067\u3082\u306a\u3044\u304b\u3002<\/p>\n<p>\u5c5e\u6027\u3082\u542b\u3081\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u304b\u306d\u3002<\/p>\n<p><strong>slim<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">li*{:draggable =&gt; :true} ng-repeat=&quot;item in itemList track by $index&quot;<\/pre>\n<p>\u307e\u305f\u3001<strong>slim<\/strong>\u3067\u5024\u306e\u306a\u3044\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u304a\u304b\u3057\u306a\u4e8b\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u7a7a\u6587\u5b57\u3092\u4e0e\u3048\u308b\u3068\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<br \/>\n<strong>slim<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">div hoge<\/pre>\n<p>\u3053\u308c\u3060\u3068\u3055\u3059\u304c\u306b\u30c0\u30e1\u3067\u3059\u306e\u3067\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">div hoge=\"\"<\/pre>\n<p>\u3068\u3059\u308b\u304b\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">.div*{ 'hoge' =&gt; '' }<\/pre>\n<p>\u3067\u3001\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u5b9a\u7fa9\u306f\u884c\u3048\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>Rails<\/h4>\n<p>\u6700\u5f8c\u306fRais\u5074\u3002<\/p>\n<h5>\u30a2\u30bb\u30c3\u30c8\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3(<em>Asset Pipeline<\/em>)<\/h5>\n<p>Rails\u306e\u30a2\u30bb\u30c3\u30c8\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3(<em>Asset Pipeline<\/em>)\u306f\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3042\u308b\u3002<\/p>\n<p><strong>app\/assets\u30d5\u30a9\u30eb\u30c0\u914d\u4e0b\u306b\u3042\u308bCSS\u3068JavaScript\u3092\u5168\u3066\u307e\u3068\u3081\u3066\u5727\u7e2e\u3057\u3001\u305d\u308c\u305e\u308c application_xxxxx.css\u3001application_xxxxx.js\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210<\/strong>\u3057\u3066\u304f\u308c\u308b\u306e\u3060\u304c\u3001\u6642\u306b\u306f\u305d\u308c\u304c\u4f59\u8a08\u306a\u304a\u7bc0\u4ecb\u306b\u611f\u3058\u308b\u3053\u3068\u3082\u3042\u308b\u3002<\/p>\n<p>\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b\u3001application.js\u306b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/\/= require_tree .<\/pre>\n<p>\u3068\u8a18\u8ff0\u3059\u308b\u3068\u3001\u4f5c\u6210\u3057\u305fjs\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u3066\u7d50\u5408\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u3059\u304c\u3001<strong>\u5f53\u7136\u5168\u3066\u7d50\u5408\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067<\/strong>\u3001\u8272\u3005\u3068\u554f\u984c\u767a\u751f\u3057\u307e\u3059\u3088\u306d\u3002<\/p>\n<p>\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u304c\u885d\u7a81\u3057\u305f\u308a\u3001\u8aad\u307f\u8fbc\u307f\u304c\u83ab\u5927\u306b\u306a\u3063\u305f\u308a\u3068\u3002\u3002<\/p>\n<p>\u3068\u3044\u3046\u4e8b\u3067\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u5358\u4f4d\u3067\u8aad\u307f\u8fbc\u307f\u305f\u3044\u306a\u3068\u601d\u3044\u307e\u3057\u3066\u3001<strong>layouts\/application.html.haml<\/strong>\u3067\u306f\u4ee5\u4e0b\u306e\u69d8\u306bRails\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u540d\u306b\u6cbf\u3063\u3066\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u540d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u69d8\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><strong>layouts\/application.html.haml<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">= javascript_include_tag controller.controller_name + '\/' + controller.action_name, &quot;data-turbolinks-track&quot; =&gt; true<\/pre>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/dir.png\"><img decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/dir.png\" alt=\"dir\" width=\"250\" class=\"alignnone size-full wp-image-6707\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/dir.png 307w, https:\/\/www.webcyou.com\/wp-content\/uploads\/dir-289x300.png 289w\" sizes=\"(max-width: 307px) 100vw, 307px\" \/><\/a><\/p>\n<p><strong>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u5358\u4f4d\u3067\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u533a\u5207\u308a\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u3068js\u30d5\u30a1\u30a4\u30eb\u306f\u5bfe\u306b\u4f5c\u6210<\/strong>\u3059\u308b\u3053\u3068\u306b\u3057\u3001<strong>config\/initializers\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067assetprecompile\u3067\u8aad\u307f\u8fbc\u307e\u308c\u3001<\/strong>JavaScript\u30d5\u30a1\u30a4\u30eb\u3082\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u6bce\u306b\u8aad\u307f\u8fbc\u307e\u308c\u308b\u69d8\u306b\u306a\u308a\u307e\u3059\u306d\u3002<\/p>\n<p><strong>config\/initializers<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Rails.application.config.assets.precompile += %w( controller_name\/action_name.js )<\/pre>\n<p>JavaScript\uff08TypeScript\uff09\u3092\u4f5c\u6210\u3059\u308b\u5ea6\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001Rails\u4ee5\u5916\u3067head\u306e\u8ffd\u52a0\u3059\u308b\u611f\u899a\u3060\u3068\u601d\u3063\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u3068\u3002<\/p>\n<p>&nbsp;<\/p>\n<h5>API<\/h5>\n<p>\u6700\u5f8c\u306fRuby on Rails\u5074\u3067\u306eAPI\u3002<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u304c\u6700\u521d\u306b\u30da\u30fc\u30b8\u306b\u8a2a\u308c\u305f\u6642\u306b\u3001<strong>\u30da\u30fc\u30b8\u8aad\u307f\u8fbc\u3053\u3093\u3060\u5f8c\u306b\u3001JavaScript\u3092\u8aad\u307f\u8fbc\u3093\u3067Rails\u306e\u65b9\u306bApi\u3092\u6295\u3052\u3066\u5e30\u3063\u3066\u6765\u305fJSON\u30c7\u30fc\u30bf\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3002<\/strong><\/p>\n<p>\u3068\u3084\u3063\u3066\u3044\u308b\u3068\u3001\u521d\u671f\u306e\u30da\u30fc\u30b8\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u304c\u9045\u304f\u306a\u308a\u307e\u3059\u306d\u3002<\/p>\n<p>\u56f3\u3067\u66f8\u304f\u3068\u4ee5\u4e0b\u306e\u69d8\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/spa1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/spa1.png\" alt=\"spa1\" width=\"400\" height=\"374\" class=\"alignnone  wp-image-6696\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/spa1.png 623w, https:\/\/www.webcyou.com\/wp-content\/uploads\/spa1-300x280.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<p>\u3055\u3059\u304c\u306b\u53b3\u3057\u3044\u306e\u3067\u3001<strong>\u30da\u30fc\u30b8\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3068\u540c\u6642\u306b\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306aJSON\u3092\u6e21\u3059\u5f62<\/strong>\u306b\u3059\u308b\u4e8b\u306b\u3088\u3063\u3066\u3088\u308a\u5feb\u9069\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/spa2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/spa2.png\" alt=\"spa2\" width=\"397\" height=\"371\" class=\"alignnone  wp-image-6697\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/spa2.png 623w, https:\/\/www.webcyou.com\/wp-content\/uploads\/spa2-300x280.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/a><\/p>\n<p>\u65b9\u6cd5\u306f\u81f3\u3063\u3066\u30b7\u30f3\u30d7\u30eb\u3067\u3001<strong>Rilas\u5074\u3067\u3001JSON\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\b\u5909\u6570\u3092\u4f5c\u6210\u3057 view\u5074\u306b\u6e21\u3057\u307e\u3059\u3002<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">@hoge = {\r\n    name: \"\u305f\u304b\u3084\u307e\"\r\n}.to_json<\/pre>\n<p>\uff08\u4eca\u56de\u306f\u4f8b\u3068\u3057\u3066\u3001name\u304c\u30ad\u30fc\u3068\u306a\u3063\u305fJSON\u30c7\u30fc\u30bf\u306e\u307f\u3002\u672c\u6765\u306f\u304d\u3061\u3093\u3068\u4f5c\u6210\uff09        <\/p>\n<p>\u5f8c\u306f\u3001view\u5074\u3067\u53d7\u3051\u53d6\u308a<strong>Angular\u5074\u306b\u6e21\u3059\u4e8b\u306b\u3088\u3063\u3066\u7121\u99c4\u306a\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u6e1b\u308a\u307e\u3059\u3002<\/strong><\/p>\n<p>\u3053\u306e\u969b\u306b\u3001\u300c&#8217;\u300d\u3084\u300c\u30bf\u30d6\u300d\u300c\u30b9\u30da\u30fc\u30b9\u300d\u306a\u3069\u306e\u524a\u9664\u51e6\u7406\u3001<strong>XSS\u5bfe\u7b56\u306f\u9069\u5207\u306b\u884c\u3063\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/strong><\/p>\n<p>\u30da\u30fc\u30b8\u8868\u793a\u5f8c\u306f\u3001\u305d\u308c\u305e\u308c\u306b\u5fdc\u3058\u305fAPI\u3092\u53e9\u304f\u4e8b\u306b\u3088\u3063\u3066\u3001SPA\u5316\u304c\u884c\u3048\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mv.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mv.png\" alt=\"mv\" width=\"598\" height=\"405\" class=\"alignnone  wp-image-6695\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/mv.png 924w, https:\/\/www.webcyou.com\/wp-content\/uploads\/mv-300x204.png 300w, https:\/\/www.webcyou.com\/wp-content\/uploads\/mv-900x611.png 900w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u3068\u3001Rails\u3092API\u5c02\u7528\u306b\u3059\u308b\u4e8b\u306b\u3088\u3063\u3066\u3001Rails\u5074\u3067\u306f\u3001API\u4f5c\u6210\u7528\u306b\u7cbe\u67fb\u3055\u308c\u3001\u30d5\u30ed\u30f3\u30c8\u5074\u3067\u306f\u3001\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306aUI\u306e\u4f5c\u6210\u304c\u51fa\u6765\u3001\u3088\u308a\u30ea\u30c3\u30c1\u306aSPA\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u53c2\u8003\u306b\u306a\u308c\u3070\u3068\u30fc\u3002\u3067\u306f\u3067\u306f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u306f\u4f55\u304b\u3068\u3001iphone\u30a2\u30d7\u30ea\u306b\u306f\u307e\u3063\u3066\u307e\u3057\u3066\u3001\u4e45\u3005\u306bweb\u306e\u65b9\u3082\u66f8\u3053\u3046\u304b\u3068\u3002 \u3044\u3084\u3041\u3002\u3057\u304b\u3057Rails\u306f\u4fbf\u5229\u3067\u3059\u306d\u3002 \u4f55\u304b\u3068\u8a71\u984c\u306eRuby on Rails\u3002 Ruby on Rails\u3092\u5229\u7528\u3059\u308b\u3068\u3001\u30b5\u30af\u30c3\u3068\u3001DB\u3084 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[155],"tags":[166,37,47,179,194,150,44,45,178,78,114,118],"class_list":{"0":"post-6691","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-ruby","7":"tag-iphone","8":"tag-iphone-","9":"tag-javascript-2","10":"tag-jquery","11":"tag-rails","12":"tag-vagrant","13":"tag-web","15":"tag-178","16":"tag-78","17":"tag-114","18":"tag-118"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/6691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6691"}],"version-history":[{"count":9,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/6691\/revisions"}],"predecessor-version":[{"id":6700,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/6691\/revisions\/6700"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}