{"id":1557,"date":"2017-04-13T12:03:10","date_gmt":"2017-04-13T03:03:10","guid":{"rendered":"http:\/\/lovelinux.mydns.jp\/?p=1557"},"modified":"2017-04-13T12:17:00","modified_gmt":"2017-04-13T03:17:00","slug":"react-native%e3%80%81redux%e3%80%81rails%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%80%81%e6%8e%b2%e7%a4%ba%e6%9d%bf%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88-2","status":"publish","type":"post","link":"https:\/\/lovelinux.mydns.jp\/?p=1557","title":{"rendered":"React Native\u3001Redux\u3001Rails\u3092\u4f7f\u3063\u3066\u3001\u63b2\u793a\u677f\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046"},"content":{"rendered":"<h3>\u306f\u3058\u3081\u306b<\/h3>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/?p=1555\">\u524d\u56de\u3001React Native\u3092Android Studio\u3068\u7d44\u307f\u5408\u308f\u305b\u3066<\/a>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001HelloWorld\u3092\u51fa\u305b\u308b\u3068\u3053\u308d\u307e\u3067<br \/>\n\u305f\u3069\u308a\u7740\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306f\u4e00\u8db3\u98db\u3073\u3067\u3001React Native\u3068Redux\u3092\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306b\u4f7f\u3044\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306bRails\u3092\u7528\u3044\u305f<br \/>\n\u63b2\u793a\u677f\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u524d\u63d0\u3068\u3057\u3066\u3001Rails\u306f\u305d\u308c\u306a\u308a\u306b\u308f\u304b\u3063\u3066\u3044\u308b\u3002React\u3082\u3088\u304f\u5206\u304b\u3063\u3066\u3044\u308b\u3002Redux\u3082\u77e5\u3063\u3066\u3044\u308b\u3002<br \/>\n\u3050\u3089\u3044\u306e\u30ec\u30d9\u30eb\u3092\u524d\u63d0\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u51fa\u6765\u4e0a\u304c\u3063\u305f\u30a2\u30d7\u30ea\u306f\u3001\u30c7\u30b6\u30a4\u30f3\u7684\u306b\u3069\u3093\u304f\u3055\u3044\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u79c1\u304c\u307e\u3060ReactNative\u306e<br \/>\n\u30b9\u30bf\u30a4\u30eb\u306e\u65b9\u6cd5\u3092\u5b66\u3093\u3067\u3044\u306a\u3044\u305f\u3081\u3067\u3059\u3002\u307e\u3041\u305d\u308c\u306f\u304a\u3044\u304a\u3044\u30d6\u30e9\u30c3\u30b7\u30e5\u30a2\u30c3\u30d7\u3059\u308b\u3053\u3068\u3068\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30bd\u30fc\u30b9\u306f\u3059\u3079\u3066GitHub\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002\u5229\u7528\u65b9\u6cd5\u306a\u3069\u542b\u3081\u3066\u3001\u8a18\u4e8b\u306e\u6700\u5f8c\u306b\u8a18\u8f09\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<h3>\u6a5f\u80fd\u4e00\u89a7<\/h3>\n<ul>\n<li>\u63b2\u793a\u677f\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u308b<\/li>\n<li>\u63b2\u793a\u677f\u3092\u9078\u629e\u3057\u305f\u3089\u3001\u5bfe\u8c61\u306e\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u308b<\/li>\n<li>\u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f\u3067\u304d\u308b<\/li>\n<\/ul>\n<p>\u6a5f\u80fd\u306f\u3053\u306e\uff13\u3064\u3060\u3051\u3002\u63b2\u793a\u677f\u3082\u8ffd\u52a0\u3067\u304d\u305f\u307b\u3046\u304c\u3044\u3044\u306e\u3067\u3057\u3087\u3046\u304c\u30fb\u30fb<br \/>\n\u3042\u307e\u308a\u6b32\u5f35\u3063\u3066\u3042\u308c\u3053\u308c\u5b9f\u88c5\u3059\u308b\u3068\u3001\u306a\u306b\u3092\u8aac\u660e\u3057\u3066\u3044\u308b\u304b\u308f\u304b\u3089\u306a\u304f\u306a\u308b\u306e\u3067\u3001\u4eca\u56de\u306f<br \/>\n\u30ab\u30c3\u30c8\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u51fa\u6765\u4e0a\u304c\u308a\u306e\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u30d1\u30fc\u30c4\u69cb\u6210\u3092\u8003\u3048\u308b<\/h3>\n<p>\u51fa\u6765\u4e0a\u304c\u308a\u306e\u753b\u9762\u30a4\u30e1\u30fc\u30b8\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u3044\u304b\u306b\u3082\u3069\u3093\u304f\u3055\u3044\u753b\u9762\u3067\u3059\u304c\u3001<br \/>\n\u3053\u308c\u306f\u79c1\u304cReact Native\u306e\u30b9\u30bf\u30a4\u30eb\u306e\u4f5c\u6cd5\u304c\u308f\u304b\u3063\u3066\u3044\u306a\u3044\u305f\u3081\u3067\u3059\u306e\u3067\u3001\u52d8\u5f01\u304f\u3060\u3055\u3044\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-31.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-31.png\" alt=\"rn-31\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1492\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-31.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-31-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u3053\u306e\u753b\u9762\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u3001\u3069\u3093\u306a\u30d1\u30fc\u30c4\uff08React\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\uff09\u304c\u5fc5\u8981\u3068\u306a\u308b\u304b<br \/>\n\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3056\u3063\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-30.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-30-683x1024.png\" alt=\"rn-30\" width=\"683\" height=\"1024\" class=\"alignnone size-large wp-image-1491\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-30-683x1024.png 683w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-30-200x300.png 200w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-30-768x1152.png 768w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-30.png 800w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/a><\/p>\n<h3>\u30a2\u30d7\u30ea\u304c\u6301\u3064\u3079\u304d\u3001\u30b9\u30c6\u30fc\u30c8\u3068\u30a4\u30d9\u30f3\u30c8\u3092\u8003\u3048\u308b<\/h3>\n<p>\u753b\u9762\u30d1\u30fc\u30c4\u306f\u8003\u3048\u7d42\u308f\u3063\u305f\u306e\u3067\u3001\u6b21\u306b\u30a2\u30d7\u30ea\u304c\u6301\u3064\u30b9\u30c6\u30fc\u30c8\u3068\u30a4\u30d9\u30f3\u30c8\u3092\u8003\u3048\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4>\u30b9\u30c6\u30fc\u30c8<\/h4>\n<ul>\n<li>\u73fe\u5728\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u63b2\u793a\u677f<\/li>\n<li>\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u63b2\u793a\u677f\u306b\u6295\u7a3f\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u7fa4<\/li>\n<li>\u6295\u7a3f\u30e6\u30fc\u30b6\u30fc<\/li>\n<li>\u6295\u7a3f\u30b3\u30e1\u30f3\u30c8<\/li>\n<li>CSRF Token<\/li>\n<\/ul>\n<p>\u5927\u4f53\u3053\u306e\uff15\u3064\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u3068\u6295\u7a3f\u30b3\u30e1\u30f3\u30c8\u306f\u3001\u30b9\u30c6\u30fc\u30c8\u306b\u3057\u306a\u304f\u3066\u3082\u826f\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001Redux\u98a8\u306b\u8a18\u8ff0\u3057\u3088\u3046\u3068\u3059\u308b\u3068<br \/>\n\u30b9\u30c6\u30fc\u30c8\u3068\u3057\u305f\u65b9\u304c\u51e6\u7406\u3057\u3084\u3059\u3044\u306e\u3067\u3001\u30b9\u30c6\u30fc\u30c8\u3068\u3057\u307e\u3059\u3002<br \/>\nCSRF Token\u3068\u306f\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306eRails\u30b5\u30fc\u30d0\u30fc\u306b\u5bfe\u3057\u3066POST\u51e6\u7406\u3092\u3059\u308b\u3068\u304d\u306b\u5fc5\u8981\u3068\u306a\u308b\u8a8d\u8a3c\u7528\u306e\u30ad\u30fc\u307f\u305f\u3044\u306a\u3082\u306e\u3067\u3059\u3002<br \/>\n\u3068\u308a\u3042\u3048\u305a\u3001\u5fc5\u8981\u306a\u3093\u3060\u306a\u3041\u30fb\u30fb\u30fb\u3050\u3089\u3044\u306b\u8003\u3048\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h4>\u30a4\u30d9\u30f3\u30c8<\/h4>\n<ul>\n<li>\u63b2\u793a\u677f\u3092\u9078\u629e\u3059\u308b<\/li>\n<li>\u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u3092\u9078\u629e\u3059\u308b<\/li>\n<li>\u6295\u7a3f\u30b3\u30e1\u30f3\u30c8\u3092\u5165\u529b\u3059\u308b<\/li>\n<li>\u63b2\u793a\u677f\u306b\u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f\u3059\u308b<\/li>\n<\/ul>\n<p>\u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u306e\u9078\u629e\u3068\u306f\u3001\u672c\u6765\u306e\u63b2\u793a\u677f\u306e\u6a5f\u80fd\u3067\u306f\u5fc5\u8981\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001<br \/>\n\u30ed\u30b0\u30a4\u30f3\u51e6\u7406\u306a\u3069\u3092\u8a2d\u3051\u306a\u3044\u3001\u4eca\u56de\u8aac\u660e\u3059\u308b\u3053\u306e\u30a2\u30d7\u30ea\u3067\u306f\u3001\u6295\u7a3f\u306e\u305f\u3073\u306b\u300c\u79c1\u306f\u8ab0\u3067\u3059\u3088\u300d\u3068<br \/>\n\u30e6\u30fc\u30b6\u30fc\u3082\u9078\u629e\u3057\u3066\u3001\u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3067\u3042\u308bRails\u30b5\u30fc\u30d0\u30fc\u306b\u5fc5\u8981\u306a\u6a5f\u80fd<\/h3>\n<p>\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\uff08\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\uff09\u306eRails\u30a2\u30d7\u30ea\u306b\u5fc5\u8981\u306a\u6a5f\u80fd\u3092\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li>\u63b2\u793a\u677f\u4e00\u89a7\u3092\u53d6\u5f97<\/li>\n<li>\u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u3092\u53d6\u5f97<\/li>\n<li>\u5bfe\u8c61\u63b2\u793a\u677f\u306e\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u3092\u53d6\u5f97<\/li>\n<li>\u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f<\/li>\n<\/ul>\n<h3>Rails\u3067\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u51e6\u7406\u3092\u5b9f\u88c5\u3059\u308b<\/h3>\n<p>Rails\u306f\u5206\u304b\u3063\u3066\u3044\u308b\u524d\u63d0\u3067\u3059\u306e\u3067\u30fb\u30fb\u3001\u3056\u30fc\u30fc\u3063\u3068\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<p>\u76ee\u6a19\u3068\u306a\u308b\u30d5\u30a1\u30a4\u30eb\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-32.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-32.png\" alt=\"rn-32\" width=\"276\" height=\"772\" class=\"alignnone size-full wp-image-1493\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-32.png 276w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-32-107x300.png 107w\" sizes=\"auto, (max-width: 276px) 100vw, 276px\" \/><\/a><br \/>\n\u307e\u305a\u306fRails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u3001React Native\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u89aa\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002<br \/>\n[bash]<br \/>\n$ cd<br \/>\n$ mkdir workspace<br \/>\n$ cd workspace<br \/>\n$ mkdir reactnative_rails_board<br \/>\n[\/bash]<\/p>\n<h4>Rails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/h4>\n<p>[bash]<br \/>\n$ cd reactnative_rails_board<br \/>\n$ rails new rnative_rails<br \/>\n[\/bash]<\/p>\n<p>Gem\u30d5\u30a1\u30a4\u30eb\u3092\u8abf\u6574\u3057\u3066\u3001bundle install<\/p>\n<p>[bash]<br \/>\n$ cd rnative_rails<br \/>\n$ nano Gemfile<br \/>\n[\/bash]<\/p>\n<p>\u672b\u5c3e\u306b\uff11\u884c\u8ffd\u8a18<br \/>\n[bash]<br \/>\ngem &#8216;therubyracer&#8217;, platforms: :ruby<br \/>\n[\/bash]<\/p>\n<h4>\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>bundle install \u3057\u3066\u3001Rails\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5<br \/>\n[bash]<br \/>\n$ bundle install<br \/>\n$ rails s<br \/>\n[\/bash]<\/p>\n<p>\u3053\u3053\u307e\u3067\u306e\u3068\u3053\u308d\u3092\u52d5\u4f5c\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\n\u30d6\u30e9\u30a6\u30b6\u30fc\u3067<\/p>\n<p>http:\/\/localhost:3000<\/p>\n<p>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u51fa\u308c\u3070\u6210\u529f\u3067\u3059\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-33.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-33.png\" alt=\"rn-33\" width=\"835\" height=\"701\" class=\"alignnone size-full wp-image-1494\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-33.png 835w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-33-300x252.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-33-768x645.png 768w\" sizes=\"auto, (max-width: 835px) 100vw, 835px\" \/><\/a><\/p>\n<h4>\u30e2\u30c7\u30eb\u4f5c\u6210\u3001\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u4f5c\u6210<\/h4>\n<p>Rails\u306e\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u3092Seed\u30d5\u30a1\u30a4\u30eb\uff08CSV\uff09\u3068\u3057\u3066\u8aad\u307f\u8fbc\u3081\u308b\u72b6\u614b\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30e2\u30c7\u30eb\u306e\u4f5c\u6210<br \/>\n[bash]<br \/>\n$ rails g model board title:string description:text<br \/>\n$ rails g model user name:string sex:integer age:integer<br \/>\n$ rails g model comment board_id:integer user_id:integer comment:text<br \/>\n[\/bash]<\/p>\n<p>\u30e2\u30c7\u30eb\u306e\u8abf\u6574<\/p>\n<p>rnative_rails\/app\/models\/comment.rb<br \/>\n[bash]<br \/>\nclass Comment < ApplicationRecord\n  belongs_to :user\nend\n\n[\/bash]\n\n\u30de\u30a4\u30b0\u30ec\u30fc\u30c8\n\n[bash]\n$ rake db:migrate\n[\/bash]\n\n\u51fa\u6765\u4e0a\u304c\u3063\u305f\u30a4\u30e1\u30fc\u30b8\u306f\u3053\u3093\u306a\u611f\u3058\u3002\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rails-1-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rails-1-1.png\" alt=\"rails-1\" width=\"827\" height=\"747\" class=\"alignnone size-full wp-image-1446\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rails-1-1.png 827w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rails-1-1-300x271.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rails-1-1-768x694.png 768w\" sizes=\"auto, (max-width: 827px) 100vw, 827px\" \/><\/a><\/p>\n<h4>Seed\u30c7\u30fc\u30bf\u306e\u4f5c\u6210<\/h4>\n<p>\u4f55\u3082\u306a\u3044\u3068\u3053\u308d\u304b\u3089\u30c7\u30fc\u30bf\u6295\u7a3f\u307e\u3067\u3064\u304f\u308a\u4e0a\u3052\u308b\u306e\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u306e\u3067\u3001\u30b7\u30fc\u30c9(seed)\u30c7\u30fc\u30bf\u3092<br \/>\n\u4f5c\u3063\u3066\u304a\u3044\u3066\u3001\u307e\u305a\u306f\u305d\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u3093\u3067\u3001\u4e00\u89a7\u8868\u793a\u3059\u308b\u3053\u3068\u3050\u3089\u3044\u304b\u3089\u59cb\u3081\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>db\/csv\/boards.csv<br \/>\n[bash]<br \/>\n1,ReactJS\u3092\u5b66\u307c\u3046,\u3042\u3044\u3046\u3048\u304a<br \/>\n2,ReactJS \u3068 Rails\u9023\u643a,\u304b\u304d\u304f\u3051\u3053<br \/>\n3,ReactJS \u767a\u5c55\u7de8,\u3055\u3057\u3059\u305b\u305d<br \/>\n4,jQuery\u5165\u9580,\u305f\u3061\u3064\u3066\u3068<br \/>\n5,jQuery\u5f97\u610f\u306a\u4eba\u96c6\u307e\u308c,\u306a\u306b\u306c\u306d\u306e<br \/>\n6,AngularJS\u5165\u9580,\u306f\u3072\u3075\u3078\u307b<br \/>\n7,vue.js\u3063\u3066\u306a\u3093\u305e,\u307e\u307f\u3080\u3081\u3082<br \/>\n[\/bash]<\/p>\n<p>db\/csv\/users.csv<\/p>\n<p>[bash]<br \/>\n1,\u82b1\u5b50,2,23<br \/>\n2,\u592a\u90ce,1,30<br \/>\n3,\u5e78\u6b21\u90ce,1,15<br \/>\n4,\u6d69\u8f1d,1,40<br \/>\n5,\u5927\u6a39,1,35<br \/>\n6,\u3059\u305a,2,28<br \/>\n7,\u96c5\u4ee3,2,38<\/p>\n<p>[\/bash]<\/p>\n<p>db\/csv\/comments.csv<\/p>\n<p>[bash]<br \/>\n&#8220;1&#8221;,&#8221;1&#8243;,&#8221;2&#8243;,&#8221;React\u306fFacebook\u304c\u958b\u767a\u3057\u3066\u3044\u308bUI(MV*\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3044\u3046View\u306e\u3088\u3046\u306a\u3082\u306e)\u306b\u7279\u5316\u3057\u305fJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002 &#8221;<br \/>\n&#8220;2&#8221;,&#8221;1&#8243;,&#8221;3&#8243;,&#8221;\u5927\u304d\u306a\u7279\u5fb4\u3068\u3057\u3066Virtual DOM(\u4eee\u60f3DOM)\u3068\u547c\u3070\u308c\u308b\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u6a5f\u69cb\u304c\u305d\u306a\u308f\u3063\u3066\u304a\u308a\u3001Web\u30da\u30fc\u30b8\u306e\u8868\u793a\u3092\u5f93\u6765\u306e .&#8221;<br \/>\n&#8220;3&#8221;,&#8221;1&#8243;,&#8221;3&#8243;,&#8221;\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u3001\u300cA JavaScript library for building user interfaces\u300d\u3068\u3042\u308b\u3088\u3046\u306b\u3001React.js\u306fUI\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002&#8221;<br \/>\n&#8220;4&#8221;,&#8221;1&#8243;,&#8221;3&#8243;,&#8221;\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u306a\u304f\u3042\u304f\u307e\u3067UI\u3092\u69cb\u7bc9\u3059\u308b\u3060\u3051\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001MVC\u3067\u3044\u3046\u3068\u3053\u308d\u306eV\u306e\u307f\u306e\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002&#8221;<br \/>\n&#8220;5&#8221;,&#8221;1&#8243;,&#8221;7&#8243;,&#8221;\u6700\u8fd1\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067facebook\/react\u3092\u305a\u3063\u3068\u4f7f\u3063\u3066\u3044\u308b\u3002\u4e16\u754c\u7684\u306b\u306f\u4e00\u90e8\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u9593\u3067\u6d41\u884c\u3063\u3066\u3044\u308b\u306e\u3060\u304c\u3001\u56fd\u5185\u3060\u3068qiita\u306e\u30bf\u30b0\u7b49\u3092\u898b\u3066\u3082\u3069\u3046\u3082\u5c11\u306a\u3044\u3002&#8221;<br \/>\n&#8220;6&#8221;,&#8221;2&#8243;,&#8221;7&#8243;,&#8221;\u306f\u3058\u3081\u306breact-rails\u3068\u3044\u3046\u3001React\u3092Asset Pipeline\u306b\u4e57\u305b\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u308c\u308bruby gems\u304c\u3042\u308b\u3002 \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u3053\u308c\u3092\u4f7f\u7528\u3057\u3066React\u306e\u516c\u5f0ftutorial\u3092\u9032\u3081\u3066\u3044\u304f\u3002&#8221;<br \/>\n&#8220;7&#8221;,&#8221;2&#8243;,&#8221;4&#8243;,&#8221;\u65e2\u5b58\u306eRails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4e2d\u3067React.js\u3092\u5229\u7528\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u305d\u306e\u6642\u306b\u3084\u3063\u305f\u3053\u3068\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u307f\u307e\u3059\u3002 \u79c1\u81ea\u8eab\u306f\u666e\u6bb5Rails\u306e\u30b5\u30fc\u30d0\u30b5\u30a4\u30c9\u3068CoffeeScript\u304c\u4e2d\u5fc3\u3067\u3001\u6700\u8fd1\u306eJavaScript\u958b\u767a\u74b0\u5883\u306b\u3064\u3044\u3066\u3042\u307e\u308a\u30ad\u30e3\u30c3\u30c1\u30a2\u30c3\u30d7\u3067\u304d&#8221;<br \/>\n&#8220;8&#8221;,&#8221;2&#8243;,&#8221;5&#8243;,&#8221;Rails\u3067Single-Page Application\u3092\u3064\u304f\u308b\u3068\u304d\u306e\u81ea\u5206\u306e\u3084\u308a\u65b9\u3092\u307e\u3068\u3081\u3066\u307f\u307e\u3059\u3002 Gem \u300cJavaScript\u3067\u66f8\u304b\u308c\u305fReact\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089HTML\u3092\u751f\u6210\u3059\u308b\u300d\u3068\u3044\u3046\u306e\u3092Ruby\u3067\u3084\u308b\u305f\u3081\u306b\u3001Ruby\u306eV8\u30a8\u30f3\u30b8\u30f3\u5b9f\u88c5\u3067 ..&#8221;<br \/>\n&#8220;9&#8221;,&#8221;2&#8243;,&#8221;2&#8243;,&#8221;react-rails\u3068\u3044\u3046React.js\u3092Rails\u306b\u7c21\u5358\u306b\u7d71\u5408\u3067\u304d\u308bgem\u3092\u4f7f\u3044\u3001React.js\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u6b21\u306e\u3088\u3046\u306a\u753b\u9762\u3092React.js\u3067\u5b9f\u88c5\u3057\u3001React\u3068\u30b5\u30fc\u30d0(Rails)\u9593\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u4e00\u89a7\u306e\u53d6\u5f97\u3084\u4f5c\u6210\u3092\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u3067\u3059\u3002&#8221;<br \/>\n&#8220;10&#8221;,&#8221;3&#8243;,&#8221;2&#8243;,&#8221;\u6700\u8fd1\u306e\u30e2\u30c0\u30f3\u306a\u30a6\u30a7\u30d6\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u8a00\u3048\u3070\u3001React+Redux\u3067\u3059\u3088\u306d\u3002\u3067\u3082\u3001\u306a\u3093\u304b\u96e3\u3057\u305d\u3046\u3068\u304b\u3001React\u3063\u3066PHP\u307f\u305f\u3044\u306bView\u306b\u30ed\u30b8\u30c3\u30af\u6df7\u3056\u308a\u305d\u3046\u3068\u304b\u611f\u3058\u3066\u5c3b\u8fbc\u307f\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u305d\u308c\u306f\u305f\u3060\u306e\u8aa4\u89e3\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002React+Redux\u306f\u305d\u3093\u306a\u306b\u96e3\u6613\u5ea6\u306e\u9ad8\u3044 .&#8221;<br \/>\n&#8220;11&#8221;,&#8221;3&#8243;,&#8221;1&#8243;,&#8221;\u7389\u77f3\u6df7\u5408\u72b6\u614b\u306b\u3042\u3063\u305fFlux\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3082\u3001\u3053\u3053\u6700\u8fd1\u3067\u306fRedux\u304c\u9996\u4e00\u3064\u629c\u3051\u51fa\u3057\u305f\u3088\u3046\u306a\u611f\u3058\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u81ea\u5206\u306fFacebook\/Flux\u6d3e\u3067\u306f\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u5148\u6708\u767a\u58f2\u3055\u308c\u305f\u300eWEB+DB PRESS vol.92\u300f\u306b\u63b2\u8f09\u3055\u308c\u3066\u3044\u305f&#8221;<br \/>\n&#8220;12&#8221;,&#8221;3&#8243;,&#8221;6&#8243;,&#8221; React.js\u3068Redux\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u69cb\u6210\u3067\u3001Web\u30b5\u30a4\u30c8\u3092\u4f5c\u3063\u3066\u307f\u308b\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\uff08React+Redux\u5165\u9580\uff09\u3067\u3059\u3002\u7b2c\u4e00\u56de\u76ee\u306f\u3001GitHub\u4e0a\u306e\u30b3\u30fc\u30c9\u304c\u8aad\u3081\u308b\u3088\u3046\u306b\u306a\u308b\u3053\u3068\u3092\u76ee\u6a19\u306b\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002&#8221;<br \/>\n&#8220;13&#8221;,&#8221;3&#8243;,&#8221;3&#8243;,&#8221;\u76ee\u7684 Redux\u3068ES6\u3078\u306e\u5165\u9580\u3002 React.js\u3092(\u3088\u3046\u3084\u304f)\u89e6\u308b\u6a5f\u4f1a\u304c\u51fa\u3066\u3001\u60c5\u5831\u91cf\u306e\u591a\u3044Fluxxor\u3068CoffeeScript\u3067\u5165\u9580\u3057\u3066\u305f\u3002 &#8221;<br \/>\n&#8220;14&#8221;,&#8221;7&#8243;,&#8221;3&#8243;,&#8221;\u79c1\u305f\u3061\u306f\u306a\u305cReact\u3067\u306f\u306a\u304fVue.js\u3092\u9078\u3093\u3060\u306e\u304b Qwintry\u30c1\u30fc\u30e0\u306f\u6700\u8fd1\u3001\u65e2\u5b58\u306e\u3059\u3079\u3066\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3092Vue.js\u306b\u79fb\u884c\u3057\u306f\u3058\u3081\u307e\u3057\u305f\u3002&#8221;<br \/>\n&#8220;15&#8221;,&#8221;6&#8243;,&#8221;4&#8243;,&#8221;AngularJS\uff08\u30a2\u30f3\u30ae\u30e5\u30e9\u30fc\u30b8\u30a7\u30a4\u30a8\u30b9\uff09\u3001\u307e\u305f\u306f Angular \u306f\u3001Google\u3068\u500b\u4eba\u3084\u4f01\u696d\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u3066\u3044\u308b\u3001\u5b8c\u5168\u306bJavaScript\u3067\u66f8\u304b\u308c\u305f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308b\u3002MIT License\u3067\u30e9\u30a4\u30bb\u30f3\u30b9\u3055\u308c\u305f&#8221;<br \/>\n&#8220;16&#8221;,&#8221;4&#8243;,&#8221;4&#8243;,&#8221;\u4eca\u5f8c\u306eWeb\u30c7\u30b6\u30a4\u30ca\u30fc\u306f\u3001\u30c7\u30b6\u30a4\u30f3\u30fbhtml\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff0b\u305d\u306e\u4ed6\u306e\u5f37\u307f\u3092\u6c42\u3081\u3089\u308c\u308b\u4e16\u306e\u4e2d\u306b\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002\u4eca\u56de\u306f\u305d\u306e\u5f37\u307f\u3068\u306a\u308a\u3046\u308b\u300cjQuery\u300d\u306b\u3064\u3044\u3066\u3054\u8aac\u660e\u3044\u305f\u3057\u307e\u3059\u3002&#8221;<br \/>\n&#8220;17&#8221;,&#8221;4&#8243;,&#8221;2&#8243;,&#8221;\u4eca\u56de\u306fjQuery\u306e\u57fa\u672c\u7684\u306a\u66f8\u304d\u65b9\u3068\u3057\u3066\u3001\u3053\u308c\u304b\u3089\u300cjQuery\u3092\u899a\u3048\u3066\u3001\u30d6\u30a4\u30d6\u30a4\u8a00\u308f\u305b\u3066\u3084\u308b\u305c\uff01\u300d\u3068\u65b0\u3057\u3044\u30b9\u30ad\u30eb\u3092\u8eab\u306b\u3064\u3051\u305f\u3044\u30c7\u30b6\u30a4\u30ca\u30fc\u3055\u3093\u306b\u306f\u4e01\u5ea6\u3044\u3044\u5185\u5bb9\u304b\u3068\u601d\u3044\u307e\u3059\u3002&#8221;<br \/>\n&#8220;18&#8221;,&#8221;5&#8243;,&#8221;2&#8243;,&#8221;\u4eca\u5e742016\u5e746\u67089\u65e5\u3001\u3064\u3044\u306b\u6b63\u5f0f\u7248\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f jQuery 3\u3002\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u305fjQuery 3\u3067\u306f\u3001\u5f93\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304b\u3089\u3001\u3044\u3063\u305f\u3044\u4f55\u304c\u5909\u308f\u3063\u305f\u306e\u304b\u30922\u56de\u306b\u5206\u3051\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002&#8221;<br \/>\n&#8220;19&#8221;,&#8221;5&#8243;,&#8221;1&#8243;,&#8221; jQuery\u306fWeb\u696d\u754c\u306e\u767a\u5c55\u306b\u5927\u3044\u306b\u5f79\u7acb\u3063\u3066\u304d\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u306eJavaScript\u304c\u9ad8\u5ea6\u5316\u3057\u3001\u304b\u3064\u30de\u30fc\u30b1\u30c3\u30c8\u30b7\u30a7\u30a2\u306e\u7e2e\u5c0f\u3057\u305f\u53e4\u3044\u30d6\u30e9\u30a6\u30b6\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u306e\u8584\u308c\u305f\u73fe\u4ee3\u306b\u304a\u3044\u3066\u3001jQuery\u3092\u672c\u5f53\u306b\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308b\u3067\u3057\u3087\u3046\u304b\uff1f\u5fc5\u8981\u6027\u3068&#8221;<br \/>\n&#8220;20&#8221;,&#8221;4&#8243;,&#8221;1&#8243;,&#8221;Web\u30c7\u30b6\u30a4\u30ca\u30fc\u3084\u30de\u30fc\u30af\u30a2\u30c3\u30d7\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u305f\u3081\u306e\u8d85\u30b3\u30f3\u30d1\u30af\u30c8\u306ajQuery\u8b1b\u5ea7\u304c\u3067\u304d\u307e\u3057\u305f\u3002JavaScript\u306e\u4e88\u5099\u77e5\u8b58\u306f\u4e0d\u8981\u3002Web\u5236\u4f5c\u306b\u5fc5\u8981\u306a\u8981\u70b9\u3060\u3051\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002 (1\/6)&#8221;<br \/>\n&#8220;21&#8221;,&#8221;7&#8243;,&#8221;6&#8243;,&#8221;\u53cc\u65b9\u5411\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u306b\u7279\u5316\u3057\u305fVue.js\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u3067\u5b66\u7fd2\u30b3\u30b9\u30c8\u3082\u4f4e\u3044\u3068\u3044\u308f\u308c\u307e\u3059\u3002\u7b2c1\u56de\u76ee\u306fVue.js\u304c\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u3057\u3066\u3001\u3069\u3093\u306a\u5f37\u307f\u3092\u3082\u3063\u3066\u3044\u308b\u306e\u304b&#8221;<br \/>\n&#8220;22&#8221;,&#8221;7&#8243;,&#8221;7&#8243;,&#8221;Angular\u3001React\u3068\u4e26\u3093\u3067\u6d77\u5916\u3067\u4eba\u6c17\u304c\u9ad8\u307e\u3063\u3066\u3044\u308b\u300cVue.js\u300d\u3002React\u3068Angular\u306e\u958b\u767a\u7d4c\u9a13\u304c\u3042\u308b\u8457\u8005\u304cVue.js\u3092\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3064\u304d\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u901a\u3058\u3066\u7279\u5fb4\u3092\u307e\u3068\u3081\u3066\u89e3\u8aac\u3057\u307e\u3059\u30022017\u5e74\u3001\u65b0\u3057\u304f\u5b66\u3073\u59cb\u3081\u308b\u304d\u3063\u304b\u3051\u306b\u3069\u3046\u305e\u3002&#8221;<\/p>\n<p>[\/bash]<\/p>\n<h4>Seed\u30c7\u30fc\u30bf\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u53cd\u6620\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/h4>\n<p>db\/seeds.rb\u3092\u7de8\u96c6<\/p>\n<p>[bash]<br \/>\nrequire &#8216;csv&#8217;<\/p>\n<p>CSV.foreach(&#8216;db\/csv\/boards.csv&#8217;) do |row|<br \/>\n  Board.create!(id: row[0], title: row[1], description: row[2])<br \/>\nend<\/p>\n<p>CSV.foreach(&#8216;db\/csv\/users.csv&#8217;) do |row|<br \/>\n  User.create!(id: row[0], name: row[1], sex: row[2], age: row[3])<br \/>\nend<\/p>\n<p>CSV.foreach(&#8216;db\/csv\/comments.csv&#8217;) do |row|<br \/>\n  Comment.create!(id: row[0], board_id: row[1], user_id: row[2], comment: row[3])<br \/>\nend<\/p>\n<p>[\/bash]<\/p>\n<h4>Seed\u30c7\u30fc\u30bf\u306e\u6295\u5165<\/h4>\n<p>[bash]<br \/>\n$ rake db:seed<br \/>\n[\/bash]<\/p>\n<h4>\u30d0\u30c3\u30af\u30a8\u30f3\u30c9API\u7528 AJAX\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u4f5c\u6210<\/h4>\n<p>[bash]<br \/>\n$ rails g controller board<br \/>\n[\/bash]<\/p>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306bAPI\u5b9f\u88c5<br \/>\nrnative_rails\/app\/controllers\/board_controller.rb<\/p>\n<p>\uff0areadBoardAndUser<br \/>\n    \u8d77\u52d5\u6642\u306b\u63b2\u793a\u677f\u4e00\u89a7\u3068\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u3092\u53d6\u5f97<br \/>\n\uff0ainsertComment<br \/>\n    \u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f<br \/>\n\uff0areadComments<br \/>\n    \u9078\u629e\u3055\u308c\u305f\u63b2\u793a\u677f\u306b\u6295\u7a3f\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u3092\u53d6\u5f97<br \/>\n    X-CSRF-Token\u3082\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>rnative_rails\/app\/controllers\/board_controller.rb<br \/>\n[bash]<br \/>\nclass BoardController < ApplicationController\n  def readBoardAndUser\n    response = {status:true}\n\n    boards = Board.all.order(\"created_at DESC\")\n    users = User.all.order(\"id\")\n    response[:boards] = boards\n    response[:users] = users\n\n    render :json=> response<br \/>\n  end<\/p>\n<p>  def insertComment<br \/>\n    response = {status:true}<\/p>\n<p>    c = Comment.new({board_id: params[:board_id], user_id: params[:user_id], comment: params[:comment]})<br \/>\n    c.save()<\/p>\n<p>    render :json=> response<br \/>\n  end<\/p>\n<p>  def readComments<br \/>\n    response = {status:true}<br \/>\n    response[&#8220;X-CSRF-Token&#8221;] = form_authenticity_token<\/p>\n<p>    recs = Comment.eager_load(:user).where(&#8220;board_id = ?&#8221;, params[:board_id])<br \/>\n            .order(&#8220;comments.created_at DESC&#8221;).as_json(include: :user)<br \/>\n    response[&#8220;rows&#8221;] = recs<\/p>\n<p>    render :json=> response<br \/>\n  end<br \/>\nend<\/p>\n<p>[\/bash]<\/p>\n<h4>routes.rb\u306e\u7de8\u96c6<\/h4>\n<p>rnative_rails\/config\/routes.rb<br \/>\n[bash]<br \/>\nRails.application.routes.draw do<br \/>\n  # For details on the DSL available within this file, see http:\/\/guides.rubyonrails.org\/routing.html<br \/>\n  get &#8216;board\/readBoardAndUser&#8217;<br \/>\n  post &#8216;board\/insertComment&#8217;<br \/>\n  get &#8216;board\/readComments\/:board_id&#8217; => &#8216;board#readComments&#8217;<\/p>\n<p>end<\/p>\n<p>[\/bash]<\/p>\n<h4>API\u306e\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u30fc\u306bAPI\u306eURL\u3092\u5165\u529b<br \/>\n[bash]<br \/>\n$ rails s<br \/>\n[\/bash]<\/p>\n<p>http:\/\/localhost:3000\/board\/readBoardAndUser<\/p>\n<p>\u4e0b\u56f3\u306e\u3088\u3046\u306bJSON\u304c\u623b\u3063\u3066\u304d\u3066\u305f\u3089\u6210\u529f\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-34.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-34.png\" alt=\"rn-34\" width=\"957\" height=\"343\" class=\"alignnone size-full wp-image-1495\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-34.png 957w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-34-300x108.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-34-768x275.png 768w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/a><br \/>\n\u3053\u308c\u3067\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u51e6\u7406\u306f\u5b8c\u6210\u3067\u3059\u3002<\/p>\n<h3>React Native\u3067\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3092\u5b9f\u88c5\u3059\u308b<\/h3>\n<h4>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/h4>\n<p>[bash]<br \/>\n$ cd<br \/>\n$ cd workspace\/reactnative_rails_board\/<br \/>\n$ react-native init rnative<br \/>\n[\/bash]<\/p>\n<h4>redux\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>[bash]<br \/>\n$ cd rnative<br \/>\n$ npm install &#8211;save redux react-redux<\/p>\n<p>[\/bash]<\/p>\n<h4>Android Studio\u304b\u3089 ADV Manager\u8d77\u52d5<\/h4>\n<p>\u30e1\u30cb\u30e5\u30fc\u3088\u308a Tools >> Android >> AVD Manager<\/p>\n<p>[bash]<br \/>\n$ \/opt\/android-studio\/bin\/studio.sh<br \/>\n[\/bash]<\/p>\n<p>AVD Manager\u3088\u308a\u4eee\u60f3\u30c7\u30d0\u30a4\u30b9\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-35.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-35.png\" alt=\"rn-35\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1496\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-35.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-35-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<h4>React Native\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3092\u8868\u793a<\/h4>\n<p>[bash]<br \/>\n$ react-native start > \/dev\/null 2>&#038;1 &#038;<br \/>\n$ react-native run-android<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u51fa\u308c\u3070\u6210\u529f\u3067\u3059\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-36.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-36.png\" alt=\"rn-36\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1497\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-36.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-36-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<h4>Redux\u306e\u6a19\u6e96\u7684\u306a\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210<\/h4>\n<p>Redux\u306e\u304a\u4f5c\u6cd5\u306b\u5f93\u3044\u3001\u6a19\u6e96\u7684\u306a\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ mkdir actions constants containers components reducers<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u8abf\u6574\u3001App.js\u4f5c\u6210<\/h4>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3067\u3042\u308b\u3000index.android.js\u3092\u8abf\u6574\u3057\u3001<br \/>\n\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u306e\u968e\u5c64\u3067\u3042\u308b App.js\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>rnative\/index.android.js<br \/>\n[bash]<br \/>\n\/**<br \/>\n * Sample React Native App<br \/>\n * https:\/\/github.com\/facebook\/react-native<br \/>\n * @flow<br \/>\n *\/<\/p>\n<p>import React, { Component } from &#8216;react&#8217;;<br \/>\nimport {<br \/>\n  AppRegistry,<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View<br \/>\n} from &#8216;react-native&#8217;;<br \/>\nimport App from &#8220;.\/components\/App&#8221;;<\/p>\n<p>export default class rnative extends Component {<br \/>\n  render() {<br \/>\n    return (<br \/>\n      <View style={styles.container}><br \/>\n        <App \/><br \/>\n      <\/View><br \/>\n    );<br \/>\n  }<br \/>\n}<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  container: {<br \/>\n    flex: 1,<br \/>\n    justifyContent: &#8216;center&#8217;,<br \/>\n    alignItems: &#8216;center&#8217;,<br \/>\n    backgroundColor: &#8216;#F5FCFF&#8217;,<br \/>\n  },<br \/>\n});<\/p>\n<p>AppRegistry.registerComponent(&#8216;rnative&#8217;, () => rnative);<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/components\/App.js<br \/>\n[bash]<br \/>\nimport React, { Component } from &#8216;react&#8217;;<br \/>\nimport {<br \/>\n  AppRegistry,<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n} from &#8216;react-native&#8217;;<\/p>\n<p>export default class App extends Component {<br \/>\n  constructor(props){<br \/>\n    super(props);<br \/>\n  }<br \/>\n  componentDidMount() {<br \/>\n  }<\/p>\n<p>  render() {<br \/>\n    return (<br \/>\n      <View style={styles.container}><br \/>\n        <Text style={styles.welcome}><br \/>\n          React Native! and Rails5.0!!<br \/>\n        <\/Text><br \/>\n      <\/View><br \/>\n    );<br \/>\n  }<br \/>\n}<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  container: {<br \/>\n    flex: 1,<br \/>\n    justifyContent: &#8216;center&#8217;,<br \/>\n    alignItems: &#8216;center&#8217;,<br \/>\n    backgroundColor: &#8216;#F5FCFF&#8217;,<br \/>\n  },<br \/>\n  welcome: {<br \/>\n    flex: 1,<br \/>\n    fontSize: 20,<br \/>\n    textAlign: &#8216;center&#8217;,<br \/>\n    margin: 10,<br \/>\n  },<br \/>\n});<\/p>\n<p>[\/bash]<\/p>\n<h4>\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>[bash]<br \/>\n$ react-native run-android<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-37.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-37.png\" alt=\"rn-37\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1498\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-37.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-37-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<h3>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u7fa4\u4f5c\u6210<\/h3>\n<p>\u65e2\u306b\u8003\u3048\u305f\u30d1\u30fc\u30c4\u69cb\u6210\u306b\u5f93\u3044\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u7fa4\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>rnative\/components\/BoardList.js<\/p>\n<p>[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n  ListView,<br \/>\n  Button<br \/>\n} from &#8216;react-native&#8217;;<\/p>\n<p>const BoardList = () => {<\/p>\n<p>  return (<br \/>\n    <View style={{flex:4}}><br \/>\n      <Text><br \/>\n        This is BoardList<br \/>\n      <\/Text><br \/>\n    <\/View><br \/>\n  );<br \/>\n}<\/p>\n<p>export default BoardList;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/components\/CommentAdd.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  TextInput,<br \/>\n  View,<br \/>\n  ListView,<br \/>\n  Button,<br \/>\n  Picker<br \/>\n} from &#8216;react-native&#8217;;<\/p>\n<p>const CommentAdd = () => {<\/p>\n<p>  return (<br \/>\n    <View style={{flex:4}}><br \/>\n      <Text><br \/>\n        This is CommentAdd<br \/>\n      <\/Text><br \/>\n    <\/View><br \/>\n  )<br \/>\n}<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  row:{<br \/>\n    flex: 1,<br \/>\n    flexDirection: &#8220;row&#8221;<br \/>\n  },<br \/>\n  comment: {<br \/>\n    width: 400<br \/>\n  },<br \/>\n  picker: {<br \/>\n    flex: 3,<br \/>\n  },<br \/>\n  btn: {<br \/>\n    flex:2<br \/>\n  },<br \/>\n});<\/p>\n<p>export default CommentAdd;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/components\/CommentList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n  ListView,<br \/>\n  Button<br \/>\n} from &#8216;react-native&#8217;;<\/p>\n<p>const CommentList = () => {<\/p>\n<p>  return (<br \/>\n    <View style={{flex:12,padding: 10}}><br \/>\n      <Text><br \/>\n          This is CommentList<br \/>\n      <\/Text><br \/>\n    <\/View><br \/>\n  );<br \/>\n}<\/p>\n<p>export default CommentList;<\/p>\n<p>[\/bash]<\/p>\n<h3>\u30e9\u30c3\u30d1\u30fc\u30af\u30e9\u30b9\u7fa4\uff08container\uff09\u4f5c\u6210<\/h3>\n<p>Redux\u3067\u306f\u3001\u30a4\u30d9\u30f3\u30c8\u3084\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5272\u308a\u5f53\u3066\u305f\u3044\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u4e00\u5c64\u4e0a\u306b<br \/>\n\u30e9\u30c3\u30d1\u30fc\u30af\u30e9\u30b9\uff08container\uff09\u3092\u304b\u3076\u305b\u3066\u3084\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30af\u30e9\u30b9\u306e\u524d\u306b\u300cC\u300d\u3092\u3064\u3051\u3066\u3001\u30af\u30e9\u30b9\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>rnative\/containers\/CBoardList.js<br \/>\n[bash]<br \/>\nimport {connect} from &#8220;react-redux&#8221;;<br \/>\nimport BoardList from &#8220;..\/components\/BoardList&#8221;;<\/p>\n<p>const mapStateToProps = (state, ownProps) => {<br \/>\n  return {<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n  }<br \/>\n}<br \/>\nconst CBoardList = connect(mapStateToProps, mapDispatchToProps)(BoardList);<\/p>\n<p>export default CBoardList;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/containers\/CCommentAdd.js<br \/>\n[bash]<br \/>\nimport {connect} from &#8220;react-redux&#8221;;<br \/>\nimport CommentAdd from &#8220;..\/components\/CommentAdd&#8221;;<\/p>\n<p>const mapStateToProps = (state, ownProps) => {<br \/>\n  return {<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n  }<br \/>\n}<\/p>\n<p>const CCommentAdd = connect(mapStateToProps, mapDispatchToProps)(CommentAdd);<\/p>\n<p>export default CCommentAdd;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/containers\/CCommentList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {connect} from &#8220;react-redux&#8221;;<br \/>\nimport CommentList from &#8220;..\/components\/CommentList&#8221;;<\/p>\n<p>const mapStateToProps = (state) => {<br \/>\n  return {<br \/>\n  }<br \/>\n}<\/p>\n<p>const CCommentList = connect(mapStateToProps, null)(CommentList);<\/p>\n<p>export default CCommentList;<\/p>\n<p>[\/bash]<\/p>\n<h3>Reducer\u306e\u4f5c\u6210<\/h3>\n<p>\u65e2\u306b\u8003\u3048\u3066\u3042\u308b\u30b9\u30c6\u30fc\u30c8\u3092\u5b9f\u88c5\u3059\u308bReducer\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u6700\u521d\u306f\u96e3\u3057\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u3053\u3093\u306a\u3082\u3093\u3060\u3068\u601d\u3063\u3066\u6163\u308c\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>rnative\/reducers\/root.js<br \/>\n[bash]<br \/>\nimport {combineReducers} from &#8220;redux&#8221;;<br \/>\nimport sel_board from &#8220;.\/sel_board&#8221;;<br \/>\nimport comments from &#8220;.\/comments&#8221;;<br \/>\nimport csrf_token from &#8220;.\/csrf_token&#8221;;<br \/>\nimport sel_user from &#8220;.\/sel_user&#8221;;<\/p>\n<p>const rootReducer = combineReducers({<br \/>\n  sel_board: sel_board,<br \/>\n  comments: comments,<br \/>\n  csrf_token: csrf_token,<br \/>\n  sel_user: sel_user<br \/>\n});<\/p>\n<p>export default rootReducer;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/reducers\/comments.js<br \/>\n[bash]<br \/>\nconst comments = (state=[], action) => {<br \/>\n  switch (action.type) {<br \/>\n    case &#8220;COMMENTS_READ&#8221;:<br \/>\n      return action.comments;<br \/>\n    default:<br \/>\n      return state;<br \/>\n  }<br \/>\n};<\/p>\n<p>export default comments;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/reducers\/csrf_token.js<br \/>\n[bash]<br \/>\nconst csrf_token = (state=&#8221;&#8221;, action) => {<br \/>\n  switch (action.type) {<br \/>\n    case &#8220;TOKEN_CHANGE&#8221;:<br \/>\n      return action.token;<br \/>\n    default:<br \/>\n      return state;<br \/>\n  }<br \/>\n}<\/p>\n<p>export default csrf_token;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/reducers\/sel_board.js<br \/>\n[bash]<br \/>\nconst sel_board = (state=-1, action) => {<br \/>\n  switch (action.type) {<br \/>\n    case &#8220;SELECT_BOARD&#8221;:<br \/>\n      return action.id;<br \/>\n    default:<br \/>\n      return state;<br \/>\n  }<br \/>\n};<\/p>\n<p>export default sel_board;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/reducers\/sel_user.js<br \/>\n[bash]<br \/>\nconst sel_user = (state=-1, action) => {<br \/>\n  switch (action.type) {<br \/>\n    case &#8220;SELECT_USER&#8221;:<br \/>\n      return action.id;<br \/>\n    default:<br \/>\n      return state;<br \/>\n  }<br \/>\n};<\/p>\n<p>export default sel_user;<\/p>\n<p>[\/bash]<\/p>\n<h3>\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c8\u30c3\u30d7\u968e\u5c64(App.js\uff09\u306e\u8abf\u6574<\/h3>\n<p>createStore\u3067\u4f5c\u6210\u3057\u305f\u30b9\u30c8\u30a2\u3092 Provider\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u6e21\u3057\u3001Provider\u306e\u5b50\u4f9b\u306b<br \/>\nApp \u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>rnative\/index.android.js<br \/>\n[bash]<br \/>\n\/**<br \/>\n * Sample React Native App<br \/>\n * https:\/\/github.com\/facebook\/react-native<br \/>\n * @flow<br \/>\n *\/<\/p>\n<p>import React, { Component } from &#8216;react&#8217;;<br \/>\nimport {<br \/>\n  AppRegistry,<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View<br \/>\n} from &#8216;react-native&#8217;;<br \/>\nimport {Provider} from &#8220;react-redux&#8221;;<br \/>\nimport {createStore} from &#8220;redux&#8221;;<br \/>\nimport App from &#8220;.\/components\/App&#8221;;<br \/>\nimport rootReducer from &#8220;.\/reducers\/root&#8221;;<\/p>\n<p>export default class rnative extends Component {<br \/>\n  constructor(props){<br \/>\n    super(props);<br \/>\n  }<\/p>\n<p>  render() {<br \/>\n    let store = createStore(rootReducer);<\/p>\n<p>    return (<br \/>\n      <Provider store={store}><br \/>\n        <App \/><br \/>\n      <\/Provider><br \/>\n    );<br \/>\n  }<\/p>\n<p>}<\/p>\n<p>AppRegistry.registerComponent(&#8216;rnative&#8217;, () => rnative);<\/p>\n<p>[\/bash]<\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u9aa8\u683c\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u306f\u306a\u304f\u30e9\u30c3\u30d1\u30fc\u30af\u30e9\u30b9\uff08container\uff09\u3067\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>rnative\/components\/App.js<br \/>\n[bash]<br \/>\nimport React, { Component } from &#8216;react&#8217;;<br \/>\nimport {<br \/>\n  AppRegistry,<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n} from &#8216;react-native&#8217;;<br \/>\nimport CBoardList from &#8220;..\/containers\/CBoardList&#8221;;<br \/>\nimport CCommentList from &#8220;..\/containers\/CCommentList&#8221;;<br \/>\nimport CCommentAdd from &#8220;..\/containers\/CCommentAdd&#8221;;<\/p>\n<p>export default class App extends Component {<br \/>\n  constructor(props){<br \/>\n    super(props);<br \/>\n  }<br \/>\n  componentDidMount() {<br \/>\n  }<\/p>\n<p>  render() {<br \/>\n    return (<br \/>\n      <View style={styles.container}><br \/>\n        <Text style={styles.welcome}><br \/>\n          React Native! and Rails5.0!!<br \/>\n        <\/Text><br \/>\n        <CBoardList \/><br \/>\n        <CCommentAdd \/><br \/>\n        <CCommentList \/><br \/>\n      <\/View><br \/>\n    );<br \/>\n  }<br \/>\n}<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  container: {<br \/>\n    flex: 1,<br \/>\n    justifyContent: &#8216;center&#8217;,<br \/>\n    alignItems: &#8216;center&#8217;,<br \/>\n    backgroundColor: &#8216;#F5FCFF&#8217;,<br \/>\n  },<br \/>\n  welcome: {<br \/>\n    flex: 1,<br \/>\n    fontSize: 20,<br \/>\n    textAlign: &#8216;center&#8217;,<br \/>\n    margin: 10,<br \/>\n  },<br \/>\n});<\/p>\n<p>[\/bash]<\/p>\n<h3>\u52d5\u4f5c\u78ba\u8a8d<\/h3>\n<p>\u3053\u3053\u307e\u3067\u306e\u3068\u3053\u308d\u3067\u52d5\u4f5c\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u51fa\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ react-native run-android<\/p>\n<p>[\/bash]<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-38.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-38.png\" alt=\"rn-38\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1499\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-38.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-38-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<h3>\u63b2\u793a\u677f\u4e00\u89a7\u3092\u8aad\u307f\u8fbc\u307f\u3001\u8868\u793a\u3059\u308b<\/h3>\n<p>\u3055\u3066\u3001\u3044\u3088\u3044\u3088\u3001\u30b5\u30fc\u30d0\u30fc\u306eAPI\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u307f\u3001\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u305d\u306e\u524d\u306b\u6e96\u5099\u3068\u3057\u3066\u3001ActionCreator\u306e\u4f5c\u6210\u3068\u3001\u5b9a\u6570\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u65e2\u306b\u8003\u3048\u3066\u3042\u308b\u3001\u30a4\u30d9\u30f3\u30c8\u304b\u3089\u3001ActionCreator\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3082\u6163\u308c\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>rnative\/actions\/index.js<br \/>\n[bash]<br \/>\nexport const select_board = (id) =>{<br \/>\n  return {<br \/>\n    type: &#8220;SELECT_BOARD&#8221;,<br \/>\n    id: id<br \/>\n  };<br \/>\n}<\/p>\n<p>export const comments_read = (comments) =>{<br \/>\n  return {<br \/>\n    type: &#8220;COMMENTS_READ&#8221;,<br \/>\n    comments: comments<br \/>\n  };<br \/>\n}<\/p>\n<p>export const token_change = (token) => {<br \/>\n  return {<br \/>\n    type: &#8220;TOKEN_CHANGE&#8221;,<br \/>\n    token: token<br \/>\n  }<br \/>\n}<\/p>\n<p>export const select_user = (id) =>{<br \/>\n  return {<br \/>\n    type: &#8220;SELECT_USER&#8221;,<br \/>\n    id: id<br \/>\n  };<br \/>\n}<\/p>\n<p>[\/bash]<\/p>\n<p>\u30a2\u30d7\u30ea\u3067\u4f7f\u3046\u5b9a\u6570\u7fa4\u3092\u6271\u3046\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306fAPI\u30b5\u30fc\u30d0\u30fc\u304c\u8d77\u52d5\u3057\u3066\u3044\u308b\u958b\u767aPC\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u30bb\u30c3\u30c8\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\n\u3053\u3053\u306f\u3001\u3054\u81ea\u8eab\u306e\u958b\u767a\u30de\u30b7\u30f3\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u30bb\u30c3\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>rnative\/constants\/index.js<br \/>\n[bash]<br \/>\nexport const HOST_ADDR=&#8217;192.168.11.6:3000&#8242;;<\/p>\n<p>[\/bash]<\/p>\n<p>\u30a2\u30d7\u30ea\u306e\u8d77\u52d5\u6642\u306bAPI\u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u63b2\u793a\u677f\u4e00\u89a7\u30fb\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u3092\u53d6\u5f97(readInit\uff09\u3057\u3001<br \/>\nCBoardList\u3068CCommentAdd \u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30bb\u30c3\u30c8\u3002<\/p>\n<p>rnative\/components\/App.js<br \/>\n[bash]<br \/>\nimport React, { Component } from &#8216;react&#8217;;<br \/>\nimport {<br \/>\n  AppRegistry,<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n  ListView<br \/>\n} from &#8216;react-native&#8217;;<br \/>\nimport {HOST_ADDR} from &#8220;..\/constants\/index&#8221;;<br \/>\nimport CBoardList from &#8220;..\/containers\/CBoardList&#8221;;<br \/>\nimport CCommentList from &#8220;..\/containers\/CCommentList&#8221;;<br \/>\nimport CCommentAdd from &#8220;..\/containers\/CCommentAdd&#8221;;<\/p>\n<p>export default class App extends Component {<br \/>\n  constructor(props){<br \/>\n    super(props);<\/p>\n<p>    let dsBoard = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});<\/p>\n<p>    this.state = {dataSourceBoard: dsBoard, users: []};<br \/>\n  }<br \/>\n  componentDidMount() {<br \/>\n    this.readInit();<br \/>\n  }<\/p>\n<p>  render() {<br \/>\n    return (<br \/>\n      <View style={styles.container}><br \/>\n        <Text style={styles.welcome}><br \/>\n          React Native! and Rails5.0!!<br \/>\n        <\/Text><br \/>\n        <CBoardList dsBoard={this.state.dataSourceBoard} \/><br \/>\n        <CCommentAdd users={this.state.users} \/><br \/>\n        <CCommentList \/><br \/>\n      <\/View><br \/>\n    );<br \/>\n  }<\/p>\n<p>  readInit() {<br \/>\n    let dsBoard = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});<\/p>\n<p>    fetch(&#8216;http:\/\/&#8217; + HOST_ADDR + &#8216;\/board\/readBoardAndUser&#8217;)<br \/>\n      .then((response) => response.json())<br \/>\n      .then((responseJson) => {<br \/>\n        this.setState({<br \/>\n          dataSourceBoard: dsBoard.cloneWithRows(responseJson.boards),<br \/>\n          users: responseJson.users<br \/>\n        });<br \/>\n      })<br \/>\n      .catch((error) => {<br \/>\n        console.error(error);<br \/>\n      });<br \/>\n  }<\/p>\n<p>}<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  container: {<br \/>\n    flex: 1,<br \/>\n    justifyContent: &#8216;center&#8217;,<br \/>\n    alignItems: &#8216;center&#8217;,<br \/>\n    backgroundColor: &#8216;#F5FCFF&#8217;,<br \/>\n  },<br \/>\n  welcome: {<br \/>\n    flex: 1,<br \/>\n    fontSize: 20,<br \/>\n    textAlign: &#8216;center&#8217;,<br \/>\n    margin: 10,<br \/>\n  },<br \/>\n});<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/containers\/CBoardList.js<br \/>\n[bash]<br \/>\nimport {connect} from &#8220;react-redux&#8221;;<br \/>\nimport {select_board} from &#8220;..\/actions\/index&#8221;;<br \/>\nimport {HOST_ADDR} from &#8220;..\/constants\/index&#8221;;<br \/>\nimport BoardList from &#8220;..\/components\/BoardList&#8221;;<br \/>\nimport {comments_read, token_change} from &#8220;..\/actions\/index&#8221;;<\/p>\n<p>const mapStateToProps = (state, ownProps) => {<br \/>\n  return {<br \/>\n    dsBoard: ownProps.dsBoard,<br \/>\n    sel_board: state.sel_board<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n    onBoardSelect: (id) => {<br \/>\n      dispatch(select_board(id));<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>const CBoardList = connect(mapStateToProps, mapDispatchToProps)(BoardList);<\/p>\n<p>export default CBoardList;<\/p>\n<p>[\/bash]<\/p>\n<p>\u8aad\u307f\u8fbc\u307e\u308c\u305f\u30c7\u30fc\u30bf\u3092\u30eb\u30fc\u30d7\u3067\u5c55\u958b\u3057\u3001\uff11\u884c\u3092\u8868\u3059 BoardLine\u3092\uff4e\u500b\u4f5c\u308b\u3002<\/p>\n<p>rnative\/components\/BoardList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n  ListView,<br \/>\n  Button<br \/>\n} from &#8216;react-native&#8217;;<br \/>\nimport BoardLine from &#8220;.\/BoardLine&#8221;<\/p>\n<p>const BoardList = ({dsBoard, sel_board, onBoardSelect}) => {<\/p>\n<p>  return (<br \/>\n    <View style={{flex:4}}><br \/>\n      <ListView\n        dataSource={dsBoard}\n        renderRow={(rowData) => {<br \/>\n          let act = rowData.id == sel_board ? true : false;<br \/>\n          return (<br \/>\n            <BoardLine\n              active= {act}\n              rowData={rowData}\n              onPress={(id) => onBoardSelect(id)}<br \/>\n            \/><br \/>\n          )<br \/>\n        }}<br \/>\n      \/><br \/>\n    <\/View><br \/>\n  );<br \/>\n}<\/p>\n<p>export default BoardList;<\/p>\n<p>[\/bash]<\/p>\n<p>\u63b2\u793a\u677f\u306e\uff11\u884c\u3092\u610f\u5473\u3059\u308bBoardLine\u30af\u30e9\u30b9\u306e\u4f5c\u6210<\/p>\n<p>[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n  Button<br \/>\n} from &#8216;react-native&#8217;;<\/p>\n<p>const BoardLine = ({active, rowData, onPress}) => {<br \/>\n  let styleTitle = [styles.title];<br \/>\n  if (active){<br \/>\n    styleTitle = [styles.title, styles.active];<br \/>\n  }<br \/>\n  return (<br \/>\n    <View style={styles.row}><br \/>\n      <Text style={styleTitle}>{rowData.title}<\/Text><br \/>\n      <Button\n        onPress={() => {<br \/>\n          onPress(rowData.id)<br \/>\n        }}<br \/>\n        title=&#8221;select&#8221; \/><\/p>\n<p>    <\/View><br \/>\n  );<br \/>\n}<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  row:{<br \/>\n    flex: 1,<br \/>\n    flexDirection: &#8220;row&#8221;<br \/>\n  },<br \/>\n  title: {<br \/>\n    width: 300<br \/>\n  },<br \/>\n  active: {<br \/>\n    backgroundColor: &#8220;#58aacc&#8221;<br \/>\n  },<br \/>\n});<\/p>\n<p>export default BoardLine;<\/p>\n<p>[\/bash]<\/p>\n<h3>Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d<\/h3>\n<p>\u4eee\u60f3\u30c7\u30d0\u30a4\u30b9\uff08Android\uff09\u304b\u3089\u63a5\u7d9a\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u3067\u3001b \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066<br \/>\n\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5<\/p>\n<p>[bash]<br \/>\n$ cd<br \/>\n$ cd workspace\/reactnative_rails_board\/rnative_rails\/<br \/>\n$ rails s -b 0.0.0.0<\/p>\n<p>[\/bash]<\/p>\n<p>[bash]<br \/>\n$ cd<br \/>\n$ cd workspace\/reactnative_rails_board\/rnative<br \/>\n$ react-native run-android<br \/>\n[\/bash]<\/p>\n<p>\u3081\u3067\u305f\u304f\u63b2\u793a\u677f\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u304b\uff1f<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-39.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-39.png\" alt=\"rn-39\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1500\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-39.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-39-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<h3>\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u3092\u8aad\u307f\u8fbc\u307f\u3001\u8868\u793a<\/h3>\n<p>\u307e\u305a\u3001\u8aad\u307f\u8fbc\u307f\u90e8\u5206\u3002<br \/>\n\u3053\u308c\u306f\u63b2\u793a\u677f\u4e00\u89a7\u306e\u53f3\u5074\u306b\u3042\u308b\u300cSELECT\u300d\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u6642\u306b<br \/>\n\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p>rnative\/containers\/CBoardList.js<br \/>\n[bash]<br \/>\nimport {connect} from &#8220;react-redux&#8221;;<br \/>\nimport {select_board} from &#8220;..\/actions\/index&#8221;;<br \/>\nimport {HOST_ADDR} from &#8220;..\/constants\/index&#8221;;<br \/>\nimport BoardList from &#8220;..\/components\/BoardList&#8221;;<br \/>\nimport {comments_read, token_change} from &#8220;..\/actions\/index&#8221;;<\/p>\n<p>const mapStateToProps = (state, ownProps) => {<br \/>\n  return {<br \/>\n    dsBoard: ownProps.dsBoard,<br \/>\n    sel_board: state.sel_board<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n    onBoardSelect: (id) => {<br \/>\n      dispatch(select_board(id));<br \/>\n      readCommentsAndRefresh(id, dispatch);<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>const readCommentsAndRefresh = (id, dispatch) =>{<br \/>\n  fetch(&#8216;http:\/\/&#8217; + HOST_ADDR + &#8216;\/board\/readComments\/&#8217; + id)<br \/>\n    .then((response) => response.json())<br \/>\n    .then((responseJson) => {<br \/>\n      dispatch(comments_read(responseJson.rows));<br \/>\n      dispatch(token_change(responseJson[&#8216;X-CSRF-Token&#8217;]));<br \/>\n    })<br \/>\n    .catch((error) => {<br \/>\n      console.error(error);<br \/>\n    });<br \/>\n}<\/p>\n<p>const CBoardList = connect(mapStateToProps, mapDispatchToProps)(BoardList);<\/p>\n<p>export default CBoardList;<\/p>\n<p>[\/bash]<\/p>\n<p>\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3093\u3060\u3042\u3068<\/p>\n<p>dispatch(comments_read(responseJson.rows));<\/p>\n<p>\u3067\u3001comments\u30b9\u30c6\u30fc\u30c8\u304c\u5909\u5316\u3059\u308b\u306e\u3067\u3001\u305d\u308c\u306b\u5408\u308f\u305b\u3066\u8868\u793a\u3092\u5909\u3048\u308b\u90e8\u5206\u3092\u5b9f\u88c5\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>rnative\/containers\/CCommentList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {connect} from &#8220;react-redux&#8221;;<br \/>\nimport CommentList from &#8220;..\/components\/CommentList&#8221;;<\/p>\n<p>const mapStateToProps = (state) => {<br \/>\n  return {<br \/>\n    datas: state.comments<br \/>\n  }<br \/>\n}<\/p>\n<p>const CCommentList = connect(mapStateToProps, null)(CommentList);<\/p>\n<p>export default CCommentList;<\/p>\n<p>[\/bash]<\/p>\n<p>\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<p>rnative\/components\/CommentList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n  ListView,<br \/>\n  Button<br \/>\n} from &#8216;react-native&#8217;;<br \/>\nimport CommentLine from &#8220;.\/CommentLine&#8221;<\/p>\n<p>const CommentList = ({datas}) => {<br \/>\n  let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});<br \/>\n  ds = ds.cloneWithRows(datas);<\/p>\n<p>  return (<br \/>\n    <View style={{flex:12,padding: 10}}><br \/>\n      <ListView\n        dataSource={ds}\n        renderRow={(rowData) => {<br \/>\n          return (<br \/>\n            <CommentLine rowData={rowData} \/><br \/>\n          )<br \/>\n        }}<br \/>\n      \/><br \/>\n    <\/View><br \/>\n  );<br \/>\n}<\/p>\n<p>export default CommentList;<\/p>\n<p>[\/bash]<\/p>\n<p>\u30b3\u30e1\u30f3\u30c8\u306e\uff11\u884c\u3092\u8868\u3059\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3059\u3002<br \/>\nrnative\/components\/CommentLine.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  View,<br \/>\n  Image,<br \/>\n} from &#8216;react-native&#8217;;<br \/>\nimport {HOST_ADDR} from &#8220;..\/constants\/index&#8221;;<\/p>\n<p>const CommentLine = ({rowData}) => {<br \/>\n  let pic = {<br \/>\n      uri: &#8216;http:\/\/&#8217; + HOST_ADDR + &#8216;\/images\/hito-&#8216; + rowData.user.id + &#8216;.jpg&#8217;<br \/>\n    };<\/p>\n<p>  return (<br \/>\n    <View style={styles.row}><br \/>\n      <Image source={pic} style={{width: 50, height: 50}}\/><br \/>\n      <Text style={styles.name}><br \/>\n        {rowData.user.name}<br \/>\n      <\/Text><br \/>\n      <Text style={styles.comment}><br \/>\n        {rowData.comment}<br \/>\n      <\/Text><br \/>\n    <\/View><br \/>\n  );<br \/>\n}<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  row:{<br \/>\n    flex: 1,<br \/>\n    flexDirection: &#8220;row&#8221;,<br \/>\n    padding: 5<br \/>\n  },<br \/>\n  name: {<br \/>\n    width: 50<br \/>\n  },<br \/>\n  comment: {<br \/>\n    width: 280<br \/>\n  },<br \/>\n});<\/p>\n<p>export default CommentLine;<\/p>\n<p>[\/bash]<\/p>\n<h3>\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u914d\u7f6e<\/h3>\n<p>\u6295\u7a3f\u8005\u306e\u30a2\u30a4\u30b3\u30f3\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u3063\u3066\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u4e0b\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u624b\u4f5c\u696d\u3067<br \/>\nrails\u306e\u30eb\u30fc\u30c8\u30d5\u30a9\u30eb\u30c0\/public\/images\/\u3000\u30d5\u30a9\u30eb\u30c0\u914d\u4e0b\u306b\u30b3\u30d4\u30fc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/hito-1.jpg\" alt=\"hito-1\" width=\"52\" height=\"59\" style=\"float:left;\" \/><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/hito-2.jpg\" alt=\"hito-2\" width=\"52\" height=\"59\" style=\"float:left;\" \/><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/hito-3.jpg\" alt=\"hito-3\" width=\"52\" height=\"59\" style=\"float:left;\" \/><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/hito-4.jpg\" alt=\"hito-4\" width=\"52\" height=\"59\" style=\"float:left;\" \/><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/hito-5.jpg\" alt=\"hito-5\" width=\"52\" height=\"59\" style=\"float:left;\" \/><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/hito-6.jpg\" alt=\"hito-6\" width=\"52\" height=\"59\" style=\"float:left;\" \/><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/hito-7.jpg\" alt=\"hito-7\" width=\"52\" height=\"59\" style=\"float:left;\" \/><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/hito-8.jpg\" alt=\"hito-8\" width=\"52\" height=\"59\" style=\"float:left;\" \/><br \/>\n<br style=\"clear: both;\" \/><\/p>\n<h3>\u52d5\u4f5c\u78ba\u8a8d<\/h3>\n<p>\u8d77\u52d5\u3057\u3066\u3001\u63b2\u793a\u677f\u3092\u3069\u308c\u304b\u9078\u629e\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ react-native run-android<br \/>\n[\/bash]<\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-40.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-40.png\" alt=\"rn-40\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1501\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-40.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-40-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<h3>\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u6a5f\u80fd<\/h3>\n<p>\u6700\u5f8c\u306b\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p>rnative\/containers\/CCommentAdd.js<br \/>\n[bash]<br \/>\nimport {connect} from &#8220;react-redux&#8221;;<br \/>\nimport {HOST_ADDR} from &#8220;..\/constants\/index&#8221;;<br \/>\nimport {comments_read,select_user} from &#8220;..\/actions\/index&#8221;;<br \/>\nimport CommentAdd from &#8220;..\/components\/CommentAdd&#8221;;<\/p>\n<p>const mapStateToProps = (state, ownProps) => {<br \/>\n  return {<br \/>\n    sel_board: state.sel_board,<br \/>\n    users: ownProps.users,<br \/>\n    current_token: state.csrf_token,<br \/>\n    sel_user: state.sel_user<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n    onCommentPost: (sel_board, user_id, comment, token) => {<br \/>\n      fetch(&#8216;http:\/\/&#8217; + HOST_ADDR + &#8216;\/board\/insertComment&#8217;, {<br \/>\n        method: &#8216;POST&#8217;,<br \/>\n        headers: {<br \/>\n          &#8216;Accept&#8217;: &#8216;application\/json&#8217;,<br \/>\n          &#8216;Content-Type&#8217;: &#8216;application\/json&#8217;,<br \/>\n          &#8216;X-CSRF-Token&#8217;: token ,<br \/>\n        },<br \/>\n        body: JSON.stringify({<br \/>\n          board_id: sel_board,<br \/>\n          user_id: user_id,<br \/>\n          comment: comment,<br \/>\n        })<br \/>\n      })<br \/>\n      .then((response) => response.json())<br \/>\n      .then((responseJson) => {<br \/>\n        readComments(sel_board, dispatch);<br \/>\n      })<br \/>\n      .catch((error) => {<br \/>\n        console.error(error);<br \/>\n      });<\/p>\n<p>    },<br \/>\n    onUserChange: (sel_user) => {<br \/>\n      dispatch(select_user(sel_user));<br \/>\n    }<\/p>\n<p>  }<br \/>\n}<\/p>\n<p>const readComments = (board_id, dispatch) => {<\/p>\n<p>  fetch(&#8216;http:\/\/&#8217; + HOST_ADDR + &#8216;\/board\/readComments\/&#8217; + board_id)<br \/>\n    .then((response) => response.json())<br \/>\n    .then((responseJson) => {<br \/>\n      dispatch(comments_read(responseJson.rows));<br \/>\n    })<br \/>\n    .catch((error) => {<br \/>\n      console.error(error);<br \/>\n    });<\/p>\n<p>}<\/p>\n<p>const CCommentAdd = connect(mapStateToProps, mapDispatchToProps)(CommentAdd);<\/p>\n<p>export default CCommentAdd;<\/p>\n<p>[\/bash]<\/p>\n<p>rnative\/components\/CommentAdd.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;;<br \/>\nimport {<br \/>\n  StyleSheet,<br \/>\n  Text,<br \/>\n  TextInput,<br \/>\n  View,<br \/>\n  ListView,<br \/>\n  Button,<br \/>\n  Picker<br \/>\n} from &#8216;react-native&#8217;;<\/p>\n<p>const CommentAdd = ({sel_board, users, current_token, sel_user, onCommentPost,onUserChange}) => {<br \/>\n  let inpText;<br \/>\n  let items = [];<br \/>\n  const Item = Picker.Item;<\/p>\n<p>  users.map((u) => {<br \/>\n    items.push(<Item key={u.id} label={u.name} value={u.id} \/>);<br \/>\n  })<\/p>\n<p>  return (<br \/>\n    <View style={{flex:4}}><br \/>\n      <View><br \/>\n        <TextInput\n          style={styles.comment}\n          placeholder=\"Let's comment...\"\n          onChangeText={(text) => inpText = text}<br \/>\n        \/><br \/>\n        <View style={styles.row}><br \/>\n          <Picker\n            style={styles.picker}\n            selectedValue={sel_user}\n            onValueChange={(val) => {<br \/>\n              onUserChange(val);<br \/>\n            }}><br \/>\n            {items}<br \/>\n          <\/Picker><\/p>\n<p>          <Button\n            style={styles.btn}\n            onPress={() => {<br \/>\n              onCommentPost(sel_board, sel_user , inpText, current_token);<br \/>\n            }}<br \/>\n            title=&#8221;\u6295\u7a3f&#8221; \/><br \/>\n        <\/View><br \/>\n      <\/View><br \/>\n    <\/View><br \/>\n  )<br \/>\n}<\/p>\n<p>const styles = StyleSheet.create({<br \/>\n  row:{<br \/>\n    flex: 1,<br \/>\n    flexDirection: &#8220;row&#8221;<br \/>\n  },<br \/>\n  comment: {<br \/>\n    width: 400<br \/>\n  },<br \/>\n  picker: {<br \/>\n    flex: 3,<br \/>\n  },<br \/>\n  btn: {<br \/>\n    flex:2<br \/>\n  },<br \/>\n});<\/p>\n<p>export default CommentAdd;<\/p>\n<p>[\/bash]<\/p>\n<h3>\u52d5\u4f5c\u78ba\u8a8d<\/h3>\n<p>\u8d77\u52d5\u3057\u3066\u3001\u63b2\u793a\u677f\u3092\u3069\u308c\u304b\u9078\u629e\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u6295\u7a3f\u6b04\u306b\u4f55\u304b\u6587\u5b57\u3092\u5165\u529b\u3057\u3001Picker\u304b\u3089\u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u3092\u9078\u629e\u3057\uff08\u3053\u308c\u5fc5\u305a\u3084\u3063\u3066\u304f\u3060\u3055\u3044\uff08\u30d0\u30b0\u3067\u3059\u304c\u30fb\u30fb\u30fb\uff09\uff09<br \/>\n\u6295\u7a3f\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3061\u3083\u3093\u3068\u6295\u7a3f\u3067\u304d\u305f\u3089\u3001\u6210\u529f\u3067\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ react-native run-android<br \/>\n[\/bash]<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-41.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-41.png\" alt=\"rn-41\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1502\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-41.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-41-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-42.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-42.png\" alt=\"rn-42\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1503\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-42.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-42-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<p>\u9577\u304f\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3067\u7d42\u4e86\u3067\u3059\u3002<\/p>\n<h3>GitHub\u306e\u516c\u958b\u30bd\u30fc\u30b9\u306e\u5229\u7528\u306e\u4ed5\u65b9<\/h3>\n<p>\u3053\u3053\u3067\u516c\u958b\u3057\u305f\u30bd\u30fc\u30b9\u306f\u3059\u3079\u3066GitHub\u306b\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002\u3054\u81ea\u7531\u306b\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002<br \/>\nAPI\u30b5\u30fc\u30d3\u30b9\uff08\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\uff09<br \/>\n<a href=\"https:\/\/github.com\/h-mito\/reactnative_rails_board\">https:\/\/github.com\/h-mito\/reactnative_rails_board<\/a><\/p>\n<p>ReactNative\u30a2\u30d7\u30ea\uff08\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\uff09<br \/>\n<a href=\"https:\/\/github.com\/h-mito\/reactnative_board\">https:\/\/github.com\/h-mito\/reactnative_board<\/a><\/p>\n<p>\u5229\u7528\u65b9\u6cd5\u306f\u4ee5\u4e0b\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ cd<br \/>\n$ mkdir workspace<br \/>\n$ cd workspace<br \/>\n$ mkdir reactnative_board_app<br \/>\n$ cd reactnative_board_app\/<br \/>\n$ git clone https:\/\/github.com\/h-mito\/reactnative_rails_board<br \/>\n$ git clone https:\/\/github.com\/h-mito\/reactnative_board<\/p>\n<p>$ cd reactnative_rails_board<br \/>\n$ bundle install<br \/>\n$ rake db:migrate<br \/>\n$ rake db:seed<br \/>\n$ rails s -b 0.0.0.0<\/p>\n<p>[\/bash]<\/p>\n<p>\u5225\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u3044\u3066<\/p>\n<p>[\/bash]<\/p>\n<p>[bash]<br \/>\n$ cd<br \/>\n$ cd workspace\/reactnative_board_app\/reactnative_board\/<br \/>\n$ npm install<br \/>\n$ nano constants\/index.js<br \/>\n[\/bash]<\/p>\n<p>\u3054\u81ea\u8eab\u306e\u958b\u767a\u30de\u30b7\u30f3\u306eIP\u30a2\u30c9\u30ec\u30b9\u306b\u66f8\u304d\u63db\u3048\u308b<br \/>\n[bash]<br \/>\nexport const HOST_ADDR=&#8217;192.168.11.6:3000&#8242;;<\/p>\n<p>[\/bash]<\/p>\n<p>Android Studio\u306e\u8d77\u52d5\u3001AVD Manager\u8d77\u52d5\u3001\u4eee\u60f3\u30c7\u30d0\u30a4\u30b9\u8d77\u52d5<br \/>\n\u5225\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u3044\u3066<\/p>\n<p>[bash]<br \/>\n$ \/opt\/android-studio\/bin\/studio.sh<br \/>\n[\/bash]<\/p>\n<p>\u30e1\u30cb\u30e5\u30fc\u3088\u308a Tools >> Android >> AVD Manager \u3092\u8d77\u52d5<\/p>\n<p>\u4eee\u60f3\u30c7\u30d0\u30a4\u30b9\u3092\u5b9f\u884c\uff08Andorid\u306e\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\uff09<\/p>\n<p>[bash]<br \/>\n$ cd<br \/>\n$ cd workspace\/reactnative_board_app\/reactnative_board\/<br \/>\n$ react-native start > \/dev\/null 2>&#038;1 &#038;<br \/>\n$ react-native run-android<\/p>\n<p>[\/bash]<\/p>\n<p>\u63b2\u793a\u677f\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u3001\u3044\u305a\u308c\u304b\u306e\u63b2\u793a\u677f\u3092\u9078\u629e\u3059\u308b\u3068<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u51fa\u308c\u3070OK\u3002<\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-44.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-44.png\" alt=\"rn-44\" width=\"465\" height=\"848\" class=\"alignnone size-full wp-image-1508\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-44.png 465w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/rn-44-165x300.png 165w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u524d\u56de\u3001React Native\u3092Android Studio\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001HelloWorld\u3092\u51fa\u305b\u308b\u3068\u3053\u308d\u307e\u3067 \u305f\u3069\u308a\u7740\u304d\u307e\u3057\u305f\u3002 \u4eca\u56de\u306f\u4e00\u8db3\u98db\u3073\u3067\u3001React Native\u3068Redux\u3092\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306b\u4f7f\u3044\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306bRails\u3092\u7528\u3044\u305f \u63b2\u793a\u677f\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u524d\u63d0\u3068\u3057\u3066\u3001Rails\u306f\u305d\u308c\u306a\u308a\u306b\u308f\u304b\u3063\u3066\u3044\u308b\u3002React\u3082\u3088\u304f\u5206\u304b\u3063\u3066\u3044\u308b\u3002Redux\u3082\u77e5\u3063\u3066\u3044\u308b\u3002 \u3050\u3089\u3044\u306e\u30ec\u30d9\u30eb\u3092\u524d\u63d0\u306b\u3057\u3066\u3044\u307e\u3059\u3002 \u51fa\u6765\u4e0a\u304c\u3063\u305f\u30a2\u30d7\u30ea\u306f\u3001\u30c7\u30b6\u30a4\u30f3\u7684\u306b\u3069\u3093\u304f\u3055\u3044\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u79c1\u304c\u307e\u3060ReactNative\u306e \u30b9\u30bf\u30a4\u30eb\u306e\u65b9\u6cd5\u3092\u5b66\u3093\u3067\u3044\u306a\u3044\u305f\u3081\u3067\u3059\u3002\u307e\u3041\u305d\u308c\u306f\u304a\u3044\u304a\u3044\u30d6\u30e9\u30c3\u30b7\u30e5\u30a2\u30c3\u30d7\u3059\u308b\u3053\u3068\u3068\u3057\u307e\u3057\u3087\u3046\u3002 \u30bd\u30fc\u30b9\u306f\u3059\u3079\u3066GitHub\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002\u5229\u7528\u65b9\u6cd5\u306a\u3069\u542b\u3081\u3066\u3001\u8a18\u4e8b\u306e\u6700\u5f8c\u306b\u8a18\u8f09\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u6a5f\u80fd\u4e00\u89a7 \u63b2\u793a\u677f\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u308b \u63b2\u793a\u677f\u3092\u9078\u629e\u3057\u305f\u3089\u3001\u5bfe\u8c61\u306e\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u308b \u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f\u3067\u304d\u308b \u6a5f\u80fd\u306f\u3053\u306e\uff13\u3064\u3060\u3051\u3002\u63b2\u793a\u677f\u3082\u8ffd\u52a0\u3067\u304d\u305f\u307b\u3046\u304c\u3044\u3044\u306e\u3067\u3057\u3087\u3046\u304c\u30fb\u30fb \u3042\u307e\u308a\u6b32\u5f35\u3063\u3066\u3042\u308c\u3053\u308c\u5b9f\u88c5\u3059\u308b\u3068\u3001\u306a\u306b\u3092\u8aac\u660e\u3057\u3066\u3044\u308b\u304b\u308f\u304b\u3089\u306a\u304f\u306a\u308b\u306e\u3067\u3001\u4eca\u56de\u306f \u30ab\u30c3\u30c8\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002 \u51fa\u6765\u4e0a\u304c\u308a\u306e\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u30d1\u30fc\u30c4\u69cb\u6210\u3092\u8003\u3048\u308b \u51fa\u6765\u4e0a\u304c\u308a\u306e\u753b\u9762\u30a4\u30e1\u30fc\u30b8\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u3044\u304b\u306b\u3082\u3069\u3093\u304f\u3055\u3044\u753b\u9762\u3067\u3059\u304c\u3001 \u3053\u308c\u306f\u79c1\u304cReact Native\u306e\u30b9\u30bf\u30a4\u30eb\u306e\u4f5c\u6cd5\u304c\u308f\u304b\u3063\u3066\u3044\u306a\u3044\u305f\u3081\u3067\u3059\u306e\u3067\u3001\u52d8\u5f01\u304f\u3060\u3055\u3044\u3002 \u3068\u308a\u3042\u3048\u305a\u3001\u3053\u306e\u753b\u9762\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u3001\u3069\u3093\u306a\u30d1\u30fc\u30c4\uff08React\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\uff09\u304c\u5fc5\u8981\u3068\u306a\u308b\u304b \u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3056\u3063\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002 \u30a2\u30d7\u30ea\u304c\u6301\u3064\u3079\u304d\u3001\u30b9\u30c6\u30fc\u30c8\u3068\u30a4\u30d9\u30f3\u30c8\u3092\u8003\u3048\u308b \u753b\u9762\u30d1\u30fc\u30c4\u306f\u8003\u3048\u7d42\u308f\u3063\u305f\u306e\u3067\u3001\u6b21\u306b\u30a2\u30d7\u30ea\u304c\u6301\u3064\u30b9\u30c6\u30fc\u30c8\u3068\u30a4\u30d9\u30f3\u30c8\u3092\u8003\u3048\u307e\u3057\u3087\u3046\u3002 \u30b9\u30c6\u30fc\u30c8 \u73fe\u5728\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u63b2\u793a\u677f \u30a2\u30af\u30c6\u30a3\u30d6\u306a\u63b2\u793a\u677f\u306b\u6295\u7a3f\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u7fa4 \u6295\u7a3f\u30e6\u30fc\u30b6\u30fc \u6295\u7a3f\u30b3\u30e1\u30f3\u30c8 CSRF Token \u5927\u4f53\u3053\u306e\uff15\u3064\u3068\u306a\u308a\u307e\u3059\u3002 \u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u3068\u6295\u7a3f\u30b3\u30e1\u30f3\u30c8\u306f\u3001\u30b9\u30c6\u30fc\u30c8\u306b\u3057\u306a\u304f\u3066\u3082\u826f\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001Redux\u98a8\u306b\u8a18\u8ff0\u3057\u3088\u3046\u3068\u3059\u308b\u3068 \u30b9\u30c6\u30fc\u30c8\u3068\u3057\u305f\u65b9\u304c\u51e6\u7406\u3057\u3084\u3059\u3044\u306e\u3067\u3001\u30b9\u30c6\u30fc\u30c8\u3068\u3057\u307e\u3059\u3002 CSRF Token\u3068\u306f\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306eRails\u30b5\u30fc\u30d0\u30fc\u306b\u5bfe\u3057\u3066POST\u51e6\u7406\u3092\u3059\u308b\u3068\u304d\u306b\u5fc5\u8981\u3068\u306a\u308b\u8a8d\u8a3c\u7528\u306e\u30ad\u30fc\u307f\u305f\u3044\u306a\u3082\u306e\u3067\u3059\u3002 \u3068\u308a\u3042\u3048\u305a\u3001\u5fc5\u8981\u306a\u3093\u3060\u306a\u3041\u30fb\u30fb\u30fb\u3050\u3089\u3044\u306b\u8003\u3048\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002 \u30a4\u30d9\u30f3\u30c8 \u63b2\u793a\u677f\u3092\u9078\u629e\u3059\u308b \u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u3092\u9078\u629e\u3059\u308b \u6295\u7a3f\u30b3\u30e1\u30f3\u30c8\u3092\u5165\u529b\u3059\u308b \u63b2\u793a\u677f\u306b\u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f\u3059\u308b \u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u306e\u9078\u629e\u3068\u306f\u3001\u672c\u6765\u306e\u63b2\u793a\u677f\u306e\u6a5f\u80fd\u3067\u306f\u5fc5\u8981\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001 \u30ed\u30b0\u30a4\u30f3\u51e6\u7406\u306a\u3069\u3092\u8a2d\u3051\u306a\u3044\u3001\u4eca\u56de\u8aac\u660e\u3059\u308b\u3053\u306e\u30a2\u30d7\u30ea\u3067\u306f\u3001\u6295\u7a3f\u306e\u305f\u3073\u306b\u300c\u79c1\u306f\u8ab0\u3067\u3059\u3088\u300d\u3068 \u30e6\u30fc\u30b6\u30fc\u3082\u9078\u629e\u3057\u3066\u3001\u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002 \u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3067\u3042\u308bRails\u30b5\u30fc\u30d0\u30fc\u306b\u5fc5\u8981\u306a\u6a5f\u80fd \u30d0\u30c3\u30af\u30a8\u30f3\u30c9\uff08\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\uff09\u306eRails\u30a2\u30d7\u30ea\u306b\u5fc5\u8981\u306a\u6a5f\u80fd\u3092\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u63b2\u793a\u677f\u4e00\u89a7\u3092\u53d6\u5f97 \u6295\u7a3f\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u3092\u53d6\u5f97 \u5bfe\u8c61\u63b2\u793a\u677f\u306e\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u3092\u53d6\u5f97 \u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f Rails\u3067\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u51e6\u7406\u3092\u5b9f\u88c5\u3059\u308b Rails\u306f\u5206\u304b\u3063\u3066\u3044\u308b\u524d\u63d0\u3067\u3059\u306e\u3067\u30fb\u30fb\u3001\u3056\u30fc\u30fc\u3063\u3068\u8aac\u660e\u3057\u307e\u3059\u3002 \u76ee\u6a19\u3068\u306a\u308b\u30d5\u30a1\u30a4\u30eb\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002 \u307e\u305a\u306fRails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u3001React Native\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u89aa\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002 [bash] $ cd $ mkdir workspace $ cd workspace $ mkdir reactnative_rails_board [\/bash] Rails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210 [bash] $ cd reactnative_rails_board $ rails new rnative_rails [\/bash] Gem\u30d5\u30a1\u30a4\u30eb\u3092\u8abf\u6574\u3057\u3066\u3001bundle install [bash] $ cd rnative_rails $ nano Gemfile [\/bash] \u672b\u5c3e\u306b\uff11\u884c\u8ffd\u8a18 [bash] gem &#8216;therubyracer&#8217;, platforms: :ruby [\/bash] \u52d5\u4f5c\u78ba\u8a8d bundle install \u3057\u3066\u3001Rails\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5 [bash] $ bundle install $ rails s [\/bash] \u3053\u3053\u307e\u3067\u306e\u3068\u3053\u308d\u3092\u52d5\u4f5c\u78ba\u8a8d\u3057\u307e\u3059\u3002 \u30d6\u30e9\u30a6\u30b6\u30fc\u3067 http:\/\/localhost:3000 \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u51fa\u308c\u3070\u6210\u529f\u3067\u3059\u3002 \u30e2\u30c7\u30eb\u4f5c\u6210\u3001\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u4f5c\u6210 Rails\u306e\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u3092Seed\u30d5\u30a1\u30a4\u30eb\uff08CSV\uff09\u3068\u3057\u3066\u8aad\u307f\u8fbc\u3081\u308b\u72b6\u614b\u306b\u3057\u307e\u3057\u3087\u3046\u3002 \u30e2\u30c7\u30eb\u306e\u4f5c\u6210 [bash] $ rails g model board title:string description:text $ rails g model user name:string sex:integer age:integer $ rails g model comment board_id:integer user_id:integer comment:text [\/bash] \u30e2\u30c7\u30eb\u306e\u8abf\u6574 rnative_rails\/app\/models\/comment.rb [bash] class Comment < ApplicationRecord belongs_to :user end [\/bash] \u30de\u30a4\u30b0\u30ec\u30fc\u30c8 [bash] $ rake db:migrate [\/bash] \u51fa\u6765\u4e0a\u304c\u3063\u305f\u30a4\u30e1\u30fc\u30b8\u306f\u3053\u3093\u306a\u611f\u3058\u3002 Seed\u30c7\u30fc\u30bf\u306e\u4f5c\u6210 \u4f55\u3082\u306a\u3044\u3068\u3053\u308d\u304b\u3089\u30c7\u30fc\u30bf\u6295\u7a3f\u307e\u3067\u3064\u304f\u308a\u4e0a\u3052\u308b\u306e\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u306e\u3067\u3001\u30b7\u30fc\u30c9(seed)\u30c7\u30fc\u30bf\u3092 \u4f5c\u3063\u3066\u304a\u3044\u3066\u3001\u307e\u305a\u306f\u305d\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u3093\u3067\u3001\u4e00\u89a7\u8868\u793a\u3059\u308b\u3053\u3068\u3050\u3089\u3044\u304b\u3089\u59cb\u3081\u307e\u3057\u3087\u3046\u3002 db\/csv\/boards.csv [bash] 1,ReactJS\u3092\u5b66\u307c\u3046,\u3042\u3044\u3046\u3048\u304a 2,ReactJS \u3068 Rails\u9023\u643a,\u304b\u304d\u304f\u3051\u3053 3,ReactJS \u767a\u5c55\u7de8,\u3055\u3057\u3059\u305b\u305d 4,jQuery\u5165\u9580,\u305f\u3061\u3064\u3066\u3068 5,jQuery\u5f97\u610f\u306a\u4eba\u96c6\u307e\u308c,\u306a\u306b\u306c\u306d\u306e 6,AngularJS\u5165\u9580,\u306f\u3072\u3075\u3078\u307b 7,vue.js\u3063\u3066\u306a\u3093\u305e,\u307e\u307f\u3080\u3081\u3082 [\/bash] db\/csv\/users.csv [bash] 1,\u82b1\u5b50,2,23 2,\u592a\u90ce,1,30 3,\u5e78\u6b21\u90ce,1,15 4,\u6d69\u8f1d,1,40 5,\u5927\u6a39,1,35 6,\u3059\u305a,2,28 7,\u96c5\u4ee3,2,38 [\/bash] db\/csv\/comments.csv [bash] &#8220;1&#8221;,&#8221;1&#8243;,&#8221;2&#8243;,&#8221;React\u306fFacebook\u304c\u958b\u767a\u3057\u3066\u3044\u308bUI(MV*\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3044\u3046View\u306e\u3088\u3046\u306a\u3082\u306e)\u306b\u7279\u5316\u3057\u305fJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002 &#8221; &#8220;2&#8221;,&#8221;1&#8243;,&#8221;3&#8243;,&#8221;\u5927\u304d\u306a\u7279\u5fb4\u3068\u3057\u3066Virtual DOM(\u4eee\u60f3DOM)\u3068\u547c\u3070\u308c\u308b\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u6a5f\u69cb\u304c\u305d\u306a\u308f\u3063\u3066\u304a\u308a\u3001Web\u30da\u30fc\u30b8\u306e\u8868\u793a\u3092\u5f93\u6765\u306e .&#8221; &#8220;3&#8221;,&#8221;1&#8243;,&#8221;3&#8243;,&#8221;\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u3001\u300cA JavaScript library for building user interfaces\u300d\u3068\u3042\u308b\u3088\u3046\u306b\u3001React.js\u306fUI\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002&#8221; &#8220;4&#8221;,&#8221;1&#8243;,&#8221;3&#8243;,&#8221;\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u306a\u304f\u3042\u304f\u307e\u3067UI\u3092\u69cb\u7bc9\u3059\u308b\u3060\u3051\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001MVC\u3067\u3044\u3046\u3068\u3053\u308d\u306eV\u306e\u307f\u306e\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002&#8221; &#8220;5&#8221;,&#8221;1&#8243;,&#8221;7&#8243;,&#8221;\u6700\u8fd1\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067facebook\/react\u3092\u305a\u3063\u3068\u4f7f\u3063\u3066\u3044\u308b\u3002\u4e16\u754c\u7684\u306b\u306f\u4e00\u90e8\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u9593\u3067\u6d41\u884c\u3063\u3066\u3044\u308b\u306e\u3060\u304c\u3001\u56fd\u5185\u3060\u3068qiita\u306e\u30bf\u30b0\u7b49\u3092\u898b\u3066\u3082\u3069\u3046\u3082\u5c11\u306a\u3044\u3002&#8221; &#8220;6&#8221;,&#8221;2&#8243;,&#8221;7&#8243;,&#8221;\u306f\u3058\u3081\u306breact-rails\u3068\u3044\u3046\u3001React\u3092Asset Pipeline\u306b\u4e57\u305b\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u308c\u308bruby gems\u304c\u3042\u308b\u3002 \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u3053\u308c\u3092\u4f7f\u7528\u3057\u3066React\u306e\u516c\u5f0ftutorial\u3092\u9032\u3081\u3066\u3044\u304f\u3002&#8221; &#8220;7&#8221;,&#8221;2&#8243;,&#8221;4&#8243;,&#8221;\u65e2\u5b58\u306eRails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4e2d\u3067React.js\u3092\u5229\u7528\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u305d\u306e\u6642\u306b\u3084\u3063\u305f\u3053\u3068\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u307f\u307e\u3059\u3002 \u79c1\u81ea\u8eab\u306f\u666e\u6bb5Rails\u306e\u30b5\u30fc\u30d0\u30b5\u30a4\u30c9\u3068CoffeeScript\u304c\u4e2d\u5fc3\u3067\u3001\u6700\u8fd1\u306eJavaScript\u958b\u767a\u74b0\u5883\u306b\u3064\u3044\u3066\u3042\u307e\u308a\u30ad\u30e3\u30c3\u30c1\u30a2\u30c3\u30d7\u3067\u304d&#8221; &#8220;8&#8221;,&#8221;2&#8243;,&#8221;5&#8243;,&#8221;Rails\u3067Single-Page Application\u3092\u3064\u304f\u308b\u3068\u304d\u306e\u81ea\u5206\u306e\u3084\u308a\u65b9\u3092\u307e\u3068\u3081\u3066\u307f\u307e\u3059\u3002 Gem \u300cJavaScript\u3067\u66f8\u304b\u308c\u305fReact\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089HTML\u3092\u751f\u6210\u3059\u308b\u300d\u3068\u3044\u3046\u306e\u3092Ruby\u3067\u3084\u308b\u305f\u3081\u306b\u3001Ruby\u306eV8\u30a8\u30f3\u30b8\u30f3\u5b9f\u88c5\u3067 ..&#8221; &#8220;9&#8221;,&#8221;2&#8243;,&#8221;2&#8243;,&#8221;react-rails\u3068\u3044\u3046React.js\u3092Rails\u306b\u7c21\u5358\u306b\u7d71\u5408\u3067\u304d\u308bgem\u3092\u4f7f\u3044\u3001React.js\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u6b21\u306e\u3088\u3046\u306a\u753b\u9762\u3092React.js\u3067\u5b9f\u88c5\u3057\u3001React\u3068\u30b5\u30fc\u30d0(Rails)\u9593\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u4e00\u89a7\u306e\u53d6\u5f97\u3084\u4f5c\u6210\u3092\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u3067\u3059\u3002&#8221; &#8220;10&#8221;,&#8221;3&#8243;,&#8221;2&#8243;,&#8221;\u6700\u8fd1\u306e\u30e2\u30c0\u30f3\u306a\u30a6\u30a7\u30d6\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u8a00\u3048\u3070\u3001React+Redux\u3067\u3059\u3088\u306d\u3002\u3067\u3082\u3001\u306a\u3093\u304b\u96e3\u3057\u305d\u3046\u3068\u304b\u3001React\u3063\u3066PHP\u307f\u305f\u3044\u306bView\u306b\u30ed\u30b8\u30c3\u30af\u6df7\u3056\u308a\u305d\u3046\u3068\u304b\u611f\u3058\u3066\u5c3b\u8fbc\u307f\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u305d\u308c\u306f\u305f\u3060\u306e\u8aa4\u89e3\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002React+Redux\u306f\u305d\u3093\u306a\u306b\u96e3\u6613\u5ea6\u306e\u9ad8\u3044 .&#8221; &#8220;11&#8221;,&#8221;3&#8243;,&#8221;1&#8243;,&#8221;\u7389\u77f3\u6df7\u5408\u72b6\u614b\u306b\u3042\u3063\u305fFlux\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3082\u3001\u3053\u3053\u6700\u8fd1\u3067\u306fRedux\u304c\u9996\u4e00\u3064\u629c\u3051\u51fa\u3057\u305f\u3088\u3046\u306a\u611f\u3058\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u81ea\u5206\u306fFacebook\/Flux\u6d3e\u3067\u306f\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u5148\u6708\u767a\u58f2\u3055\u308c\u305f\u300eWEB+DB PRESS vol.92\u300f\u306b\u63b2\u8f09\u3055\u308c\u3066\u3044\u305f&#8221; &#8220;12&#8221;,&#8221;3&#8243;,&#8221;6&#8243;,&#8221; React.js\u3068Redux\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u69cb\u6210\u3067\u3001Web\u30b5\u30a4\u30c8\u3092\u4f5c\u3063\u3066\u307f\u308b\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\uff08React+Redux\u5165\u9580\uff09\u3067\u3059\u3002\u7b2c\u4e00\u56de\u76ee\u306f\u3001GitHub\u4e0a\u306e\u30b3\u30fc\u30c9\u304c\u8aad\u3081\u308b\u3088\u3046\u306b\u306a\u308b\u3053\u3068\u3092\u76ee\u6a19\u306b\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002&#8221; &#8220;13&#8221;,&#8221;3&#8243;,&#8221;3&#8243;,&#8221;\u76ee\u7684 Redux\u3068ES6\u3078\u306e\u5165\u9580\u3002 React.js\u3092(\u3088\u3046\u3084\u304f)\u89e6\u308b\u6a5f\u4f1a\u304c\u51fa\u3066\u3001\u60c5\u5831\u91cf\u306e\u591a\u3044Fluxxor\u3068CoffeeScript\u3067\u5165\u9580\u3057\u3066\u305f\u3002 &#8221; &#8220;14&#8221;,&#8221;7&#8243;,&#8221;3&#8243;,&#8221;\u79c1\u305f\u3061\u306f\u306a\u305cReact\u3067\u306f\u306a\u304fVue.js\u3092\u9078\u3093\u3060\u306e\u304b Qwintry\u30c1\u30fc\u30e0\u306f\u6700\u8fd1\u3001\u65e2\u5b58\u306e\u3059\u3079\u3066\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3092Vue.js\u306b\u79fb\u884c\u3057\u306f\u3058\u3081\u307e\u3057\u305f\u3002&#8221; &#8220;15&#8221;,&#8221;6&#8243;,&#8221;4&#8243;,&#8221;AngularJS\uff08\u30a2\u30f3\u30ae\u30e5\u30e9\u30fc\u30b8\u30a7\u30a4\u30a8\u30b9\uff09\u3001\u307e\u305f\u306f Angular \u306f\u3001Google\u3068\u500b\u4eba\u3084\u4f01\u696d\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u3066\u3044\u308b\u3001\u5b8c\u5168\u306bJavaScript\u3067\u66f8\u304b\u308c\u305f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308b\u3002MIT License\u3067\u30e9\u30a4\u30bb\u30f3\u30b9\u3055\u308c\u305f&#8221; &#8220;16&#8221;,&#8221;4&#8243;,&#8221;4&#8243;,&#8221;\u4eca\u5f8c\u306eWeb\u30c7\u30b6\u30a4\u30ca\u30fc\u306f\u3001\u30c7\u30b6\u30a4\u30f3\u30fbhtml\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff0b\u305d\u306e\u4ed6\u306e\u5f37\u307f\u3092\u6c42\u3081\u3089\u308c\u308b\u4e16\u306e\u4e2d\u306b\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002\u4eca\u56de\u306f\u305d\u306e\u5f37\u307f\u3068\u306a\u308a\u3046\u308b\u300cjQuery\u300d\u306b\u3064\u3044\u3066\u3054\u8aac\u660e\u3044\u305f\u3057\u307e\u3059\u3002&#8221; &#8220;17&#8221;,&#8221;4&#8243;,&#8221;2&#8243;,&#8221;\u4eca\u56de\u306fjQuery\u306e\u57fa\u672c\u7684\u306a\u66f8\u304d\u65b9\u3068\u3057\u3066\u3001\u3053\u308c\u304b\u3089\u300cjQuery\u3092\u899a\u3048\u3066\u3001\u30d6\u30a4\u30d6\u30a4\u8a00\u308f\u305b\u3066\u3084\u308b\u305c\uff01\u300d\u3068\u65b0\u3057\u3044\u30b9\u30ad\u30eb\u3092\u8eab\u306b\u3064\u3051\u305f\u3044\u30c7\u30b6\u30a4\u30ca\u30fc\u3055\u3093\u306b\u306f\u4e01\u5ea6\u3044\u3044\u5185\u5bb9\u304b\u3068\u601d\u3044\u307e\u3059\u3002&#8221; &#8220;18&#8221;,&#8221;5&#8243;,&#8221;2&#8243;,&#8221;\u4eca\u5e742016\u5e746\u67089\u65e5\u3001\u3064\u3044\u306b\u6b63\u5f0f\u7248\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f jQuery 3\u3002\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u305fjQuery 3\u3067\u306f\u3001\u5f93\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304b\u3089\u3001\u3044\u3063\u305f\u3044\u4f55\u304c\u5909\u308f\u3063\u305f\u306e\u304b\u30922\u56de\u306b\u5206\u3051\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002&#8221; &#8220;19&#8221;,&#8221;5&#8243;,&#8221;1&#8243;,&#8221; jQuery\u306fWeb\u696d\u754c\u306e\u767a\u5c55\u306b\u5927\u3044\u306b\u5f79\u7acb\u3063\u3066\u304d\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u306eJavaScript\u304c\u9ad8\u5ea6\u5316\u3057\u3001\u304b\u3064\u30de\u30fc\u30b1\u30c3\u30c8\u30b7\u30a7\u30a2\u306e\u7e2e\u5c0f\u3057\u305f\u53e4\u3044\u30d6\u30e9\u30a6\u30b6\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u306e\u8584\u308c\u305f\u73fe\u4ee3\u306b\u304a\u3044\u3066\u3001jQuery\u3092\u672c\u5f53\u306b\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308b\u3067\u3057\u3087\u3046\u304b\uff1f\u5fc5\u8981\u6027\u3068&#8221; &#8220;20&#8221;,&#8221;4&#8243;,&#8221;1&#8243;,&#8221;Web\u30c7\u30b6\u30a4\u30ca\u30fc\u3084\u30de\u30fc\u30af\u30a2\u30c3\u30d7\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u305f\u3081\u306e\u8d85\u30b3\u30f3\u30d1\u30af\u30c8\u306ajQuery\u8b1b\u5ea7\u304c\u3067\u304d\u307e\u3057\u305f\u3002JavaScript\u306e\u4e88\u5099\u77e5\u8b58\u306f\u4e0d\u8981\u3002Web\u5236\u4f5c\u306b\u5fc5\u8981\u306a\u8981\u70b9\u3060\u3051\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002 (1\/6)&#8221; &#8220;21&#8221;,&#8221;7&#8243;,&#8221;6&#8243;,&#8221;\u53cc\u65b9\u5411\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u306b\u7279\u5316\u3057\u305fVue.js\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u3067\u5b66\u7fd2\u30b3\u30b9\u30c8\u3082\u4f4e\u3044\u3068\u3044\u308f\u308c\u307e\u3059\u3002\u7b2c1\u56de\u76ee\u306fVue.js\u304c\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u3057\u3066\u3001\u3069\u3093\u306a\u5f37\u307f\u3092\u3082\u3063\u3066\u3044\u308b\u306e\u304b&#8221; &#8220;22&#8221;,&#8221;7&#8243;,&#8221;7&#8243;,&#8221;Angular\u3001React\u3068\u4e26\u3093\u3067\u6d77\u5916\u3067\u4eba\u6c17\u304c\u9ad8\u307e\u3063\u3066\u3044\u308b\u300cVue.js\u300d\u3002React\u3068Angular\u306e\u958b\u767a\u7d4c\u9a13\u304c\u3042\u308b\u8457\u8005\u304cVue.js\u3092\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3064\u304d\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u901a\u3058\u3066\u7279\u5fb4\u3092\u307e\u3068\u3081\u3066\u89e3\u8aac\u3057\u307e\u3059\u30022017\u5e74\u3001\u65b0\u3057\u304f\u5b66\u3073\u59cb\u3081\u308b\u304d\u3063\u304b\u3051\u306b\u3069\u3046\u305e\u3002&#8221; [\/bash] Seed\u30c7\u30fc\u30bf\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u53cd\u6620\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8 db\/seeds.rb\u3092\u7de8\u96c6 [bash] require &#8216;csv&#8217; CSV.foreach(&#8216;db\/csv\/boards.csv&#8217;) do |row| Board.create!(id: row[0], title: row[1], description: row[2]) end CSV.foreach(&#8216;db\/csv\/users.csv&#8217;) do |row| User.create!(id: row[0], name: row[1], sex: row[2], age: row[3]) end CSV.foreach(&#8216;db\/csv\/comments.csv&#8217;) do |row| Comment.create!(id: row[0], board_id: row[1], user_id: row[2], comment: row[3]) end [\/bash] Seed\u30c7\u30fc\u30bf\u306e\u6295\u5165 [bash] $ rake db:seed [\/bash] \u30d0\u30c3\u30af\u30a8\u30f3\u30c9API\u7528 AJAX\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u4f5c\u6210 [bash] $ rails g...\n<\/p>\n","protected":false},"author":1,"featured_media":1505,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[6,77],"tags":[71,79,72],"class_list":{"0":"post-1557","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-rails","8":"category-react","9":"tag-rails","10":"tag-react-native","11":"tag-reactjs"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1557"}],"version-history":[{"count":2,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1557\/revisions"}],"predecessor-version":[{"id":1562,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1557\/revisions\/1562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/media\/1505"}],"wp:attachment":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}