{"id":1553,"date":"2017-04-13T11:58:23","date_gmt":"2017-04-13T02:58:23","guid":{"rendered":"http:\/\/lovelinux.mydns.jp\/?p=1553"},"modified":"2017-04-14T14:31:32","modified_gmt":"2017-04-14T05:31:32","slug":"rails-5-0-%e3%81%a8-react%e3%80%81redux%e3%80%81ajax%e3%82%92%e7%b5%84%e3%81%bf%e5%90%88%e3%82%8f%e3%81%9b%e3%81%a6%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-2","status":"publish","type":"post","link":"https:\/\/lovelinux.mydns.jp\/?p=1553","title":{"rendered":"Rails 5.0 \u3068 React\u3001Redux\u3001Ajax\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u63b2\u793a\u677f\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046"},"content":{"rendered":"<h3>\u306f\u3058\u3081\u306b<\/h3>\n<p>Redux\u3092\u52c9\u5f37\u3057\u3066\u3001\u3088\u3046\u3084\u304f\u5927\u7b4b\u3092\u7406\u89e3\u3057\u3001Rails\u3068\u306e\u9023\u643a\u65b9\u6cd5\u3082\u5206\u304b\u3063\u305f\u306e\u3067\u3001<br \/>\nRails\uff0bReact+Redux\uff0bAjax\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u3061\u3087\u3063\u3068\u3057\u305f\u63b2\u793a\u677f\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>Rails\uff0bReact+Redux\uff0bAjax\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u5fc5\u8981\u306a\u30ce\u30a6\u30cf\u30a6\u306f\u3060\u3044\u305f\u3044\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u7d39\u4ecb\u3059\u308b\u30bd\u30fc\u30b9\u306f<a href=\"https:\/\/github.com\/h-mito\/rails_redux_board\">GitHub\u306e\u3053\u3053\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u306e\u3067<\/a>\u81ea\u7531\u306b\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u5bfe\u8c61\u3068\u3059\u308b\u8aad\u8005\u306f Rails\u306f\u305d\u3053\u305d\u3053\u77e5\u3063\u3066\u3044\u308b\u3002React\u3082\u52c9\u5f37\u3057\u305f\u3002Redux\u3082\u52c9\u5f37\u3057\u305f\u3001\u3082\u3057\u304f\u306f\u52c9\u5f37\u4e2d\u3067\u3042\u308b<br \/>\n\u3068\u3044\u3046\u65b9\u304c\u5bfe\u8c61\u3067\u3059\u3002<\/p>\n<h3>Rails + React + Redux\u306e\u74b0\u5883\u3092\u6574\u3048\u308b<\/h3>\n<p>\u3053\u308c\u306b\u95a2\u3057\u3066\u306f\u66f8\u304d\u51fa\u3059\u3068\u9577\u304f\u306a\u308b\u306e\u3067\u3001<a href=\"http:\/\/lovelinux.mydns.jp\/?p=1551\">\u3053\u306e\u8a18\u4e8b\u3092\u53c2\u7167\u3057\u3066\u6e96\u5099\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/a><br \/>\nTodo\u30b5\u30f3\u30d7\u30eb\u3092\u52d5\u304b\u3059\u5fc5\u8981\u306f\u306a\u3044\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a Rails\u3068React\u3068Redux\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u9023\u643a\u306e\u90e8\u5206\u306e\u4f5c\u696d\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Rails\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084node.js npm \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u306f\u4ed6\u306b\u5c71\u307b\u3069\u4e01\u5be7\u306b\u66f8\u304b\u308c\u305f\u30b5\u30a4\u30c8\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u63b2\u793a\u677f\u30a2\u30d7\u30ea\u4f5c\u6210\u958b\u59cb<\/h3>\n<p>\u3055\u3066\u3001\u3044\u3088\u3044\u3088\u63b2\u793a\u677f\u30a2\u30d7\u30ea\u306e\u4f5c\u6210\u958b\u59cb\u3067\u3059\u3002<\/p>\n<p>\u5b8c\u6210\u5f62\u306e\u52d5\u4f5c\u30a4\u30e1\u30fc\u30b8\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<br \/>\n\u5de6\u306b\u63b2\u793a\u677f\u4e00\u89a7\u304c\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u3066\u3001\u53f3\u306b\u6295\u7a3f\u3092\u884c\u3046\u5834\u6240\u3068\u6295\u7a3f\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u611f\u3058\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21-1024x432.png\" alt=\"redux-21\" width=\"806\" height=\"340\" class=\"alignnone size-large wp-image-1428\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21-1024x432.png 1024w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21-300x127.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21-768x324.png 768w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21.png 1393w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/a><\/p>\n<h4>Rails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/h4>\n<p>[bash]<br \/>\n$ cd ~\/<br \/>\n$ mkdir workspace<br \/>\n$ cd workspace<br \/>\n$ rails new rails_redux_board<br \/>\n$ cd rails_redux_board<\/p>\n<p>[\/bash]<\/p>\n<p>\u3053\u308c\u4ee5\u964d\u306e Rails\u3068React\u3001Redux\u306e\u7d44\u307f\u5408\u308f\u305b\u306e\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u624b\u9806\u306f<a href=\"\">\u3053\u3061\u3089\u306e\u8a18\u4e8b\uff08Rails5.0 \u306b React\u3001Redux\u3092\u5c0e\u5165\u3057\u3066\u3001Redux\u672c\u5bb6\u306eTodo\u30b5\u30f3\u30d7\u30eb\u3092\u52d5\u304b\u3059\uff09<\/a>\u3092\u53c2\u7167\u306b\u3057\u3066\u9811\u5f35\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001Redux\u672c\u5bb6\u306eTodo\u304c\u52d5\u304b\u305b\u305f\u3089OK\u3067\u3059\u3002\u624b\u9593\u3092\u7701\u304d\u305f\u3051\u308c\u3070Todo\u30a2\u30d7\u30ea\u306e\u30b3\u30d4\u30da\u306f\u3057\u306a\u304f\u3066\u7d50\u69cb\u3067\u3059\u3002<\/p>\n<h4>components.js\u7de8\u96c6<\/h4>\n<p>app\/assets\/javascripts\/components.js<\/p>\n<p>board.js\u306f\u30a2\u30d7\u30ea\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u308bJS\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002\u3053\u3053\u306b\u5b9a\u7fa9\u3057\u305f\u30af\u30e9\u30b9\u540d\uff08const\u5ba3\u8a00\uff09\u3092<br \/>\nwindow\u306e\u4e0b\u306b\u30bb\u30c3\u30c8\uff08\u5909\u6570\u3068\u3057\u3066\u516c\u958b\uff09\u3057\u3066\u3084\u308b\u3002<br \/>\n\uff08\u610f\u5473\u306f\u3044\u307e\u3044\u3061\u7406\u89e3\u3067\u304d\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u5fc5\u9808\u307f\u305f\u3044\u3067\u3059\uff09<\/p>\n<p>\u5168\u3066\u6d88\u3057\u3066\u4ee5\u4e0b\u306e4\u884c\u3092\u8ffd\u8a18\u3002Todo\u30a2\u30d7\u30ea\u3092\u79fb\u690d\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001Todos\u306e\u884c\u306f\u4e0d\u8981<\/p>\n<p>[bash]<br \/>\nwindow.React = require(&#8216;react&#8217;);<br \/>\nwindow.ReactDOM = require(&#8216;react-dom&#8217;);<br \/>\nwindow.Todos = require(&#8216;.\/todos.js&#8217;);<br \/>\nwindow.Board = require(&#8216;.\/board.js&#8217;);<br \/>\n[\/bash]<\/p>\n<h4>React+Redux\u306e\u63b2\u793a\u677f\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u308bJS\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210<\/h4>\n<p>app\/assets\/javascripts\/board.js<br \/>\n[bash]<br \/>\nimport React, { Component } from &#8216;react&#8217;<br \/>\nimport { render } from &#8216;react-dom&#8217;<br \/>\nimport { Provider } from &#8216;react-redux&#8217;<br \/>\nimport { createStore } from &#8216;redux&#8217;<br \/>\nimport rootReducer from &#8216;.\/reducers\/root&#8217;<br \/>\nimport App from &#8216;.\/components\/App&#8217;<\/p>\n<p>const Board = ({}) => {<br \/>\n  return (<br \/>\n    <Provider store={createStore(rootReducer)}><br \/>\n      <App \/><br \/>\n    <\/Provider><br \/>\n  )<br \/>\n}<\/p>\n<p>export default Board<br \/>\n[\/bash]<\/p>\n<h4>\u3059\u3079\u3066\u306eReducer\u3092\u307e\u3068\u3081\u308b\u89aaReducer\u4f5c\u6210<\/h4>\n<p>app\/assets\/javascripts\/reducers\/root.js<\/p>\n<p>[bash]<br \/>\nimport {combineReducers} from &#8220;redux&#8221;<\/p>\n<p>const rootReducer = combineReducers({})<\/p>\n<p>export default rootReducer<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c8\u30c3\u30d7\u968e\u5c64\u3068\u306a\u308bApp.js\u3092\u4f5c\u6210<\/h4>\n<p>app\/assets\/javascripts\/components\/App.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<\/p>\n<p>const App = ({}) => {<br \/>\n  return (<\/p>\n<div>\n<h3>This is Board Application with Rails,React,Redux<\/h3>\n<\/p><\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default App<br \/>\n[\/bash]<\/p>\n<h4>Rails\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3068\u30d3\u30e5\u30fc\u3092\u4f5c\u6210<\/h4>\n<p>[bash]<br \/>\n$ rails g controller board index<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30d3\u30e5\u30fc\u7de8\u96c6<\/h4>\n<p>\u30d3\u30e5\u30fc\u3092\u7de8\u96c6\u3057\u3066\u3001\u63b2\u793a\u677f\u306eReact\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\napp\/views\/board\/index.html.erb<\/p>\n<p>[bash]<\/p>\n<h1>Board#index<\/h1>\n<p>Find me in app\/views\/board\/index.html.erb<\/p>\n<p><%= react_component('Board') %><\/p>\n<p>[\/bash]<\/p>\n<h4>\u3053\u3053\u307e\u3067\u3067\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>\u3053\u308c\u3067\u6700\u4f4e\u9650\u306e\u3068\u3053\u308d\u306f\u51fa\u6765\u305f\u306e\u3067\u3001Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n<p>http:\/\/localhost:3000\/board\/index<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u306e\u30a4\u30e1\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-22.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-22.png\" alt=\"redux-22\" width=\"537\" height=\"248\" class=\"alignnone size-full wp-image-1429\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-22.png 537w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-22-300x139.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/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>\u30de\u30a4\u30b0\u30ec\u30fc\u30c8<\/p>\n<p>[bash]<br \/>\n$ rake db:migrate<br \/>\n[\/bash]<\/p>\n<p>\u51fa\u6765\u4e0a\u304c\u3063\u305f\u30a4\u30e1\u30fc\u30b8\u306f\u3053\u3093\u306a\u611f\u3058\u3002<br \/>\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>\u5b8c\u6210\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u30d1\u30fc\u30c4\u69cb\u6210\u3092\u5c0e\u304d\u51fa\u3059<\/h4>\n<p>\u3044\u3088\u3044\u3088React\uff0bReudx\u306e\u672c\u8ad6\u306b\u5165\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305a\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u306e\u3082\u306e\u304c\u3067\u304d\u308c\u3070\u3044\u3044\u306a\u3068\u3044\u3046\u7406\u60f3\u578b\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21-1024x432.png\" alt=\"redux-21\" width=\"806\" height=\"340\" class=\"alignnone size-large wp-image-1428\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21-1024x432.png 1024w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21-300x127.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21-768x324.png 768w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-21.png 1393w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/a><br \/>\n\u3053\u308c\u3092\u30d1\u30fc\u30c4\u306b\u5206\u89e3\u3059\u308b\u3068\u3053\u3093\u306a\u611f\u3058<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-23.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-23-1024x478.png\" alt=\"redux-23\" width=\"806\" height=\"376\" class=\"alignnone size-large wp-image-1430\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-23.png 1024w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-23-300x140.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-23-768x359.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/a><\/p>\n<h4>React\u3063\u307d\u3044\u767a\u60f3\u304b\u3089Redux\u306e\u767a\u60f3\u306b\u30b7\u30d5\u30c8\u3059\u308b<\/h4>\n<p>React\u306e\u5834\u5408\u306f\u5358\u7d14\u306b\u3053\u306e\u30d1\u30fc\u30c4\u30a4\u30e1\u30fc\u30b8\u3067\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u3063\u3066\u3044\u3051\u3070\u3088\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001<br \/>\nReact+Redux\u306e\u5834\u5408\u306f\u3001\u3061\u3087\u3063\u3068\u767a\u60f3\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u4e0a\u3067\u8868\u793a\u3057\u305f\u30d1\u30fc\u30c4\u306f\u5168\u3066\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>Redux\u3067\u306f React\u3067\u8a00\u3046\u30b9\u30c6\u30fc\u30c8\u3084\u30a4\u30d9\u30f3\u30c8\u3092\u7d44\u307f\u8fbc\u307f\u305f\u3044\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u3072\u3068\u3064<br \/>\n\u30e9\u30c3\u30d1\u30fc\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u308a\u307e\u3059\u3002\u3053\u308c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<h4>\u5fc5\u8981\u306a\u30b9\u30c6\u30fc\u30c8\u3092\u8003\u3048\u308b<\/h4>\n<p>\u3053\u3053\u3067\u307e\u305a\u8003\u3048\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u304c\u3001\u306a\u306b\u3092\u30b9\u30c6\u30fc\u30c8\u3068\u3057\u3066\u4fdd\u6301\u3059\u308b\u304b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<br \/>\n\u3053\u308c\u306fReact\u306e\u8003\u3048\u65b9\u3068\u5168\u304f\u540c\u3058\u3067OK\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u73fe\u5728\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u63b2\u793a\u677f<\/li>\n<li>\u63b2\u793a\u677f\u306b\u6295\u7a3f\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7<\/li>\n<\/ul>\n<p>\u63b2\u793a\u677f\u4e00\u89a7\u3001\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u306f\u521d\u671f\u5024\u3092\u4e0e\u3048\u305f\u3042\u3068\u306f\u56fa\u5b9a\u306a\u306e\u3067\u3001\u30b9\u30c6\u30fc\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h4>\u767a\u751f\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u3092\u8003\u3048\u308b<\/h4>\n<p>\u63b2\u793a\u677f\u3067\u767a\u751f\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u306f\u4ee5\u4e0b\u306e2\u3064\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u63b2\u793a\u677f\u9078\u629e<\/li>\n<li>\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f<\/li>\n<\/ul>\n<h4>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u4e0a\u306e\u30e9\u30c3\u30d1\u30fc\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f?<\/h4>\n<p>\u30b9\u30c6\u30fc\u30c8\u3068\u30a4\u30d9\u30f3\u30c8\u3092\u3069\u3046\u3059\u308b\u304b\u304c\u6c7a\u307e\u3063\u305f\u306e\u3067\u3001\u30e9\u30c3\u30d1\u30fc\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u631f\u3080\u4f4d\u7f6e\u3092\u8003\u3048\u307e\u3059\u3002<br \/>\n\u63b2\u793a\u677f\u9078\u629e\u306e\u30a4\u30d9\u30f3\u30c8\u306fBoardList\u30af\u30e9\u30b9\u304b\u3089\u767a\u751f\u3059\u308b\u306e\u3067\u3001\u305d\u306e\u4e0a\u306b\u30e9\u30c3\u30d1\u30fc\u3092\u304b\u3076\u305b\u307e\u3059\u3002<br \/>\n\u30e9\u30c3\u30d1\u30fc\u540d\u306f\u6c7a\u307e\u308a\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30e9\u30c3\u30d1\u30fc\u3059\u308b\u30af\u30e9\u30b9\u306e\u524d\u306b\u300cC\u300d\u3092\u3064\u3051\u305f\u30af\u30e9\u30b9\u3068\u3057\u307e\u3059\u3002<br \/>\n\u3067\u3059\u306e\u3067\u3001\u3053\u306e\u5834\u5408\u306f\u300cCBoardList\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u63b2\u793a\u677f\u306e\u6295\u7a3f\u3092\u884c\u3046\u306e\u306fCommentAdd\u30af\u30e9\u30b9\u3067\u3059\u306e\u3067\u3001\u3053\u306e\u30e9\u30c3\u30d1\u30fc\u306f\u300cCCommentAdd\u300d\u30af\u30e9\u30b9\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u30a4\u30d9\u30f3\u30c8\u306f\u767a\u751f\u3057\u307e\u305b\u3093\u304c\u3001\u63b2\u793a\u677f\u304c\u9078\u629e\u3055\u308c\u305f\u6642\u306b\u3001\u63b2\u793a\u677f\u306b\u6295\u7a3f\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u3092<br \/>\n\u30ea\u30d5\u30ec\u30c3\u30b7\u30e5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u3092\u4fdd\u6301\u3057\u3066\u3044\u308b CommentList\u30af\u30e9\u30b9\u306e\u30e9\u30c3\u30d1\u30fc\u3068\u3057\u3066<br \/>\n\u300cCCommentList\u300d\u30af\u30e9\u30b9\u3082\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>App\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u8868\u793a\u306e\u5927\u67a0\u3092\u4f5c\u308b<\/h4>\n<p>\u96e3\u3057\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u6211\u6162\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>app\/assets\/javascripts\/components\/App.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport CBoardList from &#8220;..\/containers\/CBoardList&#8221;<br \/>\nimport CCommentAdd from &#8220;..\/containers\/CCommentAdd&#8221;<br \/>\nimport CCommentList from &#8220;..\/containers\/CCommentList&#8221;<\/p>\n<p>const App = ({}) => {<br \/>\n  return (<\/p>\n<div>\n<div className=\"left-side\">\n        <CBoardList \/>\n      <\/div>\n<div className=\"right-side\">\n        <CCommentAdd \/><br \/>\n        <CCommentList \/><\/p><\/div>\n<\/p><\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default App<br \/>\n[\/bash]<\/p>\n<p>app\/assets\/javascripts\/containers\/CBoardList.js<\/p>\n<p>[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport {connect} from &#8220;react-redux&#8221;<br \/>\nimport BoardList from &#8220;..\/components\/BoardList&#8221;<\/p>\n<p>const mapStateToProps = (state) =>{<br \/>\n  return {<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n    onBoardClick: (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>app\/assets\/javascripts\/containers\/CCommentAdd.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport {connect} from &#8220;react-redux&#8221;<br \/>\nimport CommentAdd from &#8220;..\/components\/CommentAdd&#8221;<\/p>\n<p>const mapStateToProps = (state) => {<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>app\/assets\/javascripts\/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 {<\/p>\n<p>  }<br \/>\n}<\/p>\n<p>const CCommentList = connect(mapStateToProps,null)(CommentList)<\/p>\n<p>export default CCommentList<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30e9\u30c3\u30d1\u30fc\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089connect\u3055\u308c\u305f\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\uff08\u672c\u4f53\uff09\u3092\u4f5c\u308b<\/h4>\n<p>connect(mapStateToProps,mapDispatchToProps)(xxxxxxx) \u3068\u3057\u3066\u4f5c\u3089\u308c\u305f<br \/>\nxxxxxxxx\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>app\/assets\/javascripts\/components\/BoardList.js<\/p>\n<p>[bash]<br \/>\nimport React from &#8220;react&#8221;<\/p>\n<p>const BoardList = ({}) => {<br \/>\n  return (<\/p>\n<div>\n<h2>This is Board List<\/h2>\n<\/p><\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default BoardList<\/p>\n<p>[\/bash]<\/p>\n<p>app\/assets\/javascripts\/components\/CommentAdd.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<\/p>\n<p>const CommentAdd = ({}) => {<\/p>\n<p>  return (<\/p>\n<h3>This is Comment Add Area<\/h3>\n<p>  )<br \/>\n}<\/p>\n<p>export default CommentAdd<br \/>\n[\/bash]<\/p>\n<p>app\/assets\/javascripts\/components\/CommentList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<\/p>\n<p>const CommentList = ({}) => {<\/p>\n<p>  return (<\/p>\n<h3>This is Comment List<\/h3>\n<p>  )<br \/>\n}<\/p>\n<p>export default CommentList<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u5229\u7528\u3059\u308bCSS\u4f5c\u6210<\/h4>\n<p>\u3068\u308a\u3042\u3048\u305a\u5168\u3066\u8cbc\u308a\u4ed8\u3051\u3066\u304a\u304d\u307e\u3059\u3002\u5358\u7d14\u306b\u30b3\u30d4\u30da\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>app\/assets\/stylesheets\/board.scss<\/p>\n<p>[bash]<br \/>\n\/\/ Place all the styles related to the board controller here.<br \/>\n\/\/ They will automatically be included in application.css.<br \/>\n\/\/ You can use Sass (SCSS) here: http:\/\/sass-lang.com\/<br \/>\ndiv.left-side{<br \/>\n  float: left;<br \/>\n  width: 400px;<br \/>\n}<\/p>\n<p>div.right-side {<br \/>\n  float: left;<br \/>\n  width: 600px;<br \/>\n}<\/p>\n<p>div.bline{<\/p>\n<p>  label.id{<br \/>\n    display: inline-block;<br \/>\n    width: 40px;<br \/>\n  }<\/p>\n<p>  label.title{<br \/>\n    display: inline-block;<br \/>\n    width: 280px;<br \/>\n  }<\/p>\n<p>  label.active{<br \/>\n    background-color: #f68c8c;<br \/>\n  }<br \/>\n}<\/p>\n<p>div.cadd {<br \/>\n  padding: 20px;<br \/>\n  border: 3px solid #c86a87;<br \/>\n  height: 80px;<\/p>\n<p>  textarea {<br \/>\n    width: 450px;<br \/>\n    float: left;<br \/>\n  }<br \/>\n  button {<br \/>\n    float: left;<br \/>\n    width: 80px;<br \/>\n    height: 60px;<br \/>\n  }<br \/>\n}<\/p>\n<p>div.clist {<br \/>\n  clear: both;<br \/>\n  margin-top: 30px;<br \/>\n  border-bottom:  1px solid #cccccc;<br \/>\n}<\/p>\n<p>div.cline {<br \/>\n  padding: 5px;<br \/>\n  border-top: 1px solid #cccccc;<br \/>\n  border-right: 1px solid #cccccc;<br \/>\n  border-left: 1px solid #cccccc;<br \/>\n  clear: both;<br \/>\n  height: 90px;<\/p>\n<p>  label.name {<br \/>\n    display: inline-block;<br \/>\n    width: 100px;<br \/>\n  }<\/p>\n<p>  label.sex {<br \/>\n    display: inline-block;<br \/>\n    width: 50px;<br \/>\n    font-size: 9px;<br \/>\n    color: #555555;<br \/>\n  }<\/p>\n<p>  label.age {<br \/>\n    display: inline-block;<br \/>\n    width: 50px;<br \/>\n    font-size: 9px;<br \/>\n    color: #555555;<br \/>\n  }<\/p>\n<p>  div.icon {<br \/>\n    float: left;<br \/>\n    width: 50px;<br \/>\n  }<br \/>\n  div.comment{<br \/>\n    float: left;<br \/>\n    width: 500px;<br \/>\n    padding: 5px;<br \/>\n    padding-left: 20px;<\/p>\n<p>  }<\/p>\n<p>}<\/p>\n<p>[\/bash]<\/p>\n<h4>\u3053\u3053\u307e\u3067\u3067\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>\u3053\u308c\u3067\u6700\u4f4e\u9650\u306e\u3068\u3053\u308d\u306f\u51fa\u6765\u305f\u306e\u3067\u3001Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n<p>http:\/\/localhost:3000\/board\/index<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u306e\u30a4\u30e1\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-25.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-25.png\" alt=\"redux-25\" width=\"785\" height=\"333\" class=\"alignnone size-full wp-image-1431\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-25.png 785w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-25-300x127.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-25-768x326.png 768w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/a><\/p>\n<h4>\u30b9\u30c6\u30fc\u30c8\uff08Reducer\uff09\u3092\u8003\u3048\u308b<\/h4>\n<p>\u65e2\u306b\u8003\u3048\u3066\u3044\u308b\u30b9\u30c6\u30fc\u30c8\u306f\u4ee5\u4e0b\u306e\u3082\u306e\u3067\u3059\u3002<br \/>\n\u3053\u308c\u3089\uff11\u3064\uff11\u3064\u3092Reducer\u3068\u3057\u3066\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li>\u73fe\u5728\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u63b2\u793a\u677f<\/li>\n<li>\u63b2\u793a\u677f\u306b\u6295\u7a3f\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7<\/li>\n<\/ul>\n<p>\u63b2\u793a\u677f\u4e00\u89a7\u3001\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u306f \u4eca\u56de\u306f\u521d\u671f\u5024\u3092\u4e0e\u3048\u305f\u3042\u3068\u306f\u5909\u52d5\u3057\u306a\u3044\u306e\u3067\u3001\u30b9\u30c6\u30fc\u30c8\u3068\u306f\u8003\u3048\u307e\u305b\u3093\u3002<\/p>\n<p>\u6700\u521d\u306f\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u30fb\u30fb\u30fb\u3053\u3093\u306a\u3082\u306e\u3060\u3068\u601d\u3063\u3066\u6211\u6162\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>app\/assets\/javascripts\/reducers\/sel_board.js<br \/>\n[bash]<br \/>\nconst sel_board = (state=-1, action)=> {<\/p>\n<p>  switch (action.type) {<br \/>\n    case &#8220;BOARD_SELECT&#8221;:<br \/>\n      return action.id<br \/>\n    default:<br \/>\n      return state<br \/>\n  }<\/p>\n<p>}<\/p>\n<p>export default sel_board<\/p>\n<p>[\/bash]<\/p>\n<p>app\/assets\/javascripts\/reducers\/comments.js<br \/>\n[bash]<br \/>\nconst comments = (state=[], action) => {<br \/>\n  if (action.comments == undefined) {<br \/>\n    return []<br \/>\n  }<br \/>\n  else {<br \/>\n    return action.comments<br \/>\n  }<br \/>\n}<\/p>\n<p>export default comments<\/p>\n<p>[\/bash]<\/p>\n<h4>\u767a\u751f\u3059\u308b\u30a4\u30d9\u30f3\u30c8(ActionCreator)\u3092\u8003\u3048\u308b<\/h4>\n<p>\u63b2\u793a\u677f\u3067\u767a\u751f\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u306f\u4ee5\u4e0b\u306e2\u3064\u3067\u3057\u305f\u3002\u3053\u308c\u3092\u3082\u3068\u306bActionCreator\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n\u3053\u308c\u3082\u7406\u89e3\u3057\u304c\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u6211\u6162\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li>\u63b2\u793a\u677f\u9078\u629e<\/li>\n<li>\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f<\/li>\n<\/ul>\n<p>app\/assets\/javascripts\/actions\/index.js<br \/>\n[bash]<br \/>\nexport const board_select = (id) => {<br \/>\n  return {<br \/>\n    type: &#8220;BOARD_SELECT&#8221;,<br \/>\n    id: id<br \/>\n  }<br \/>\n}<\/p>\n<p>export const comment_read = (comments) => {<br \/>\n  return {<br \/>\n    type: &#8220;COMMENT_READ&#8221;,<br \/>\n    comments: comments<br \/>\n  }<br \/>\n}<\/p>\n<p>[\/bash]<\/p>\n<h4>rootReducer\u306e\u8abf\u6574<\/h4>\n<p>Reducer\u304c\u51fa\u63c3\u3063\u305f\u306e\u3067\u30eb\u30fc\u30c8Reducer\u3092\u8abf\u6574\u3057\u307e\u3059\u3002<\/p>\n<p>app\/assets\/javascripts\/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;<\/p>\n<p>const rootReducer = combineReducers({<br \/>\n  sel_board: sel_board,<br \/>\n  comments: comments<br \/>\n})<\/p>\n<p>export default rootReducer<br \/>\n[\/bash]<\/p>\n<h3>\u63b2\u793a\u677f\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b<\/h3>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u9aa8\u683c\u304c\u51fa\u6765\u4e0a\u304c\u3063\u3066\u304d\u3066\u3001Reducer\u3082\u51fa\u63c3\u3063\u305f\u306e\u3067\u3001<br \/>\n\u3044\u3088\u3044\u3088\u63b2\u793a\u677f\u4e00\u89a7\u3092\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4>Rails\u3067\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f<\/h4>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092\u8ffd\u8a18\uff08index\u306e\u4e2d\u306e2\u884c\uff09<\/p>\n<p>app\/controllers\/board_controller.rb<\/p>\n<p>[bash]<br \/>\nclass BoardController < ApplicationController\n  def index\n    @boards = Board.all.order(\"created_at DESC\")\n    @users = User.all.order(\"id\")\n  end\nend\n\n[\/bash]\n\n\n\n\n<h4>\u30d3\u30e5\u30fc\u8abf\u6574<\/h4>\n<p>\u8aad\u307f\u8fbc\u3093\u3060\u5024\u3092React\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u5f15\u6570\u3068\u3057\u3066\u4e0e\u3048\u307e\u3059\u3002<br \/>\napp\/views\/board\/index.html.erb<\/p>\n<p>[bash]<\/p>\n<h1>Board#index<\/h1>\n<p>Find me in app\/views\/board\/index.html.erb<\/p>\n<p><%= react_component('Board', {boards: @boards, users: @users}) %><\/p>\n<p>[\/bash]<\/p>\n<h4>\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u8abf\u6574<\/h4>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c8\u30c3\u30d7\u968e\u5c64\u3092\u8abf\u6574\u3057\u307e\u3059\u3002<\/p>\n<p>app\/assets\/javascripts\/board.js<\/p>\n<p>[bash]<br \/>\nimport React, { Component } from &#8216;react&#8217;<br \/>\nimport { render } from &#8216;react-dom&#8217;<br \/>\nimport { Provider } from &#8216;react-redux&#8217;<br \/>\nimport { createStore } from &#8216;redux&#8217;<br \/>\nimport rootReducer from &#8216;.\/reducers\/root&#8217;<br \/>\nimport App from &#8216;.\/components\/App&#8217;<\/p>\n<p>const Board = ({boards, users}) => {<br \/>\n  return (<br \/>\n    <Provider store={createStore(rootReducer, {})}><br \/>\n      <App boards={boards} users={users} \/><br \/>\n    <\/Provider><br \/>\n  )<br \/>\n}<\/p>\n<p>export default Board<\/p>\n<p>[\/bash]<\/p>\n<p>app\/assets\/javascripts\/components\/App.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport CBoardList from &#8220;..\/containers\/CBoardList&#8221;<br \/>\nimport CCommentAdd from &#8220;..\/containers\/CCommentAdd&#8221;<br \/>\nimport CCommentList from &#8220;..\/containers\/CCommentList&#8221;<\/p>\n<p>const App = ({boards, users}) => {<br \/>\n  return (<\/p>\n<div>\n<div className=\"left-side\">\n        <CBoardList boards={boards} \/>\n      <\/div>\n<div className=\"right-side\">\n        <CCommentAdd users={users} \/><br \/>\n        <CCommentList \/><\/p><\/div>\n<\/p><\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default App<\/p>\n<p>[\/bash]<\/p>\n<h4>\u63b2\u793a\u677f\u4e00\u89a7\u306e\u30e9\u30c3\u30d1\u30fc\u300cCBoardList\u300d\u3001\u63b2\u793a\u677f\u4e00\u89a7\u300cBoardList\u300d\u3092\u8abf\u6574<\/h4>\n<p>app\/assets\/javascripts\/containers\/CBoardList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport {connect} from &#8220;react-redux&#8221;<br \/>\nimport {board_select, comment_read} from &#8220;..\/actions\/index&#8221;<br \/>\nimport BoardList from &#8220;..\/components\/BoardList&#8221;<\/p>\n<p>const mapStateToProps = (state, ownProps) =>{<br \/>\n  return {<br \/>\n    datas: ownProps.boards<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n    onBoardClick: (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>app\/assets\/javascripts\/components\/BoardList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport BoardLine from &#8220;.\/BoardLine&#8221;<\/p>\n<p>const BoardList = ({datas, selb, onBoardClick}) => {<br \/>\n  let list = []<\/p>\n<p>  datas.map((b) => {<br \/>\n    let active = (b.id == selb)<br \/>\n    list.push(<BoardLine\n                key={b.id}\n                id={b.id}\n                title={b.title}\n                active={active}\n                onClick={() => onBoardClick(b.id)}<br \/>\n              \/>)<br \/>\n  })<\/p>\n<p>  return (<\/p>\n<div>\n      {list}\n    <\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default BoardList<\/p>\n<p>[\/bash]<\/p>\n<h4>\u63b2\u793a\u677f\u306e\u4e00\u884c\u3092\u8868\u3059\u300cBoardLine\u300d\u3092\u4f5c\u6210<\/h4>\n<p>[bash]<br \/>\nimport React from &#8220;react&#8221;<\/p>\n<p>const BoardLine = ({id, title,active, onClick}) => {<br \/>\n  let cssact = active ? &#8220;active&#8221; : &#8220;&#8221;<\/p>\n<p>  return (<\/p>\n<div className=\"bline\">\n      <label className={\"id \" + cssact}>{id}<\/label><br \/>\n      <label className={\"title \" + cssact}>{title}<\/label><br \/>\n      <button onClick={() => onClick()}>\u9078\u629e<\/button>\n    <\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default BoardLine<br \/>\n[\/bash]<\/p>\n<h4>\u3053\u3053\u307e\u3067\u3067\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>\u3053\u308c\u3067\u6700\u4f4e\u9650\u306e\u3068\u3053\u308d\u306f\u51fa\u6765\u305f\u306e\u3067\u3001Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n<p>http:\/\/localhost:3000\/board\/index<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u306e\u30a4\u30e1\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-26.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-26.png\" alt=\"redux-26\" width=\"744\" height=\"378\" class=\"alignnone size-full wp-image-1432\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-26.png 744w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-26-300x152.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/a><\/p>\n<h3>\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u30a8\u30ea\u30a2\u4f5c\u6210<\/h3>\n<p>\u30e9\u30c3\u30d1\u30fc\u300cCCommentAdd\u300d\u3001\u6295\u7a3f\u30a8\u30ea\u30a2\u672c\u4f53\u300cCommentAdd\u300d\u3092\u8abf\u6574\u3057\u307e\u3059\u3002<\/p>\n<p>app\/assets\/javascripts\/containers\/CCommentAdd.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport {connect} from &#8220;react-redux&#8221;<br \/>\nimport CommentAdd from &#8220;..\/components\/CommentAdd&#8221;<br \/>\nimport {comment_add, comment_read} from &#8220;..\/actions\/index&#8221;<\/p>\n<p>const mapStateToProps = (state, ownProps) => {<br \/>\n  return {<br \/>\n    users: ownProps.users,<br \/>\n    sel_board: state.sel_board<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n    onAddComment: (sel_board, user, cmt) => {<br \/>\n    }<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>app\/assets\/javascripts\/components\/CommentAdd.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<\/p>\n<p>const CommentAdd = ({users, sel_board, onAddComment}) => {<br \/>\n  let ulist = []<br \/>\n  let inpCom,inpUser<\/p>\n<p>  users.map((u) => {<br \/>\n    ulist.push(<option key = {u.id} value={u.id}>{u.name}<\/option>)<br \/>\n  })<\/p>\n<p>  return (<\/p>\n<div className=\"cadd\">\n      <select ref={(node) => {inpUser=node}}><br \/>\n        {ulist}<br \/>\n      <\/select><br \/>\n      <br \/>\n      <textarea rows=\"4\" ref={(node) => {inpCom = node}} \/><br \/>\n      <button onClick={(e) => {<br \/>\n        if (inpCom.value.trim() == &#8220;&#8221;){<br \/>\n          return<br \/>\n        }<\/p>\n<p>        if (sel_board == -1){<br \/>\n          alert(&#8220;\u63b2\u793a\u677f\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044&#8221;)<br \/>\n          return<br \/>\n        }<\/p>\n<p>        onAddComment(sel_board, inpUser.value, inpCom.value)<br \/>\n        inpCom.value = &#8220;&#8221;<br \/>\n      }}>\u6295\u7a3f<\/button>\n    <\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default CommentAdd<\/p>\n<p>[\/bash]<\/p>\n<h4>\u3053\u3053\u307e\u3067\u3067\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>\u3053\u308c\u3067\u6700\u4f4e\u9650\u306e\u3068\u3053\u308d\u306f\u51fa\u6765\u305f\u306e\u3067\u3001Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n<p>http:\/\/localhost:3000\/board\/index<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u306e\u30a4\u30e1\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-27.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-27-1024x351.png\" alt=\"redux-27\" width=\"806\" height=\"276\" class=\"alignnone size-large wp-image-1433\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-27-1024x351.png 1024w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-27-300x103.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-27-768x263.png 768w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-27.png 1068w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/a><\/p>\n<h3>\u63b2\u793a\u677f\u306e\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b<\/h3>\n<p>\u3044\u3044\u611f\u3058\u306b\u51fa\u6765\u4e0a\u304c\u3063\u3066\u304d\u305f\u306e\u3067\u3001\u6b21\u306f\u5de6\u306e\u63b2\u793a\u677f\u306e\u9078\u629e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001<br \/>\n\u53f3\u5074\u306b\u305d\u306e\u63b2\u793a\u677f\u306b\u6295\u7a3f\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u90e8\u5206\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u3001BoardList\u306e\u30e9\u30c3\u30d1\u30fc\u30af\u30e9\u30b9\u306e\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30bd\u30fc\u30b9\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002<br \/>\nAJAX\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u308b\u90e8\u5206\u306f\u3001\u6b21\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<br \/>\nAJAX\u306e\u4ed5\u65b9\u306a\u3069\u306f\u4ed6\u306e\u30b5\u30a4\u30c8\u306a\u3069\u8aad\u3093\u3067\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30dd\u30a4\u30f3\u30c8\u306fAJAX\u3067\u8aad\u307f\u8fbc\u3093\u3060\u30c7\u30fc\u30bf\u3092<\/p>\n<p>dispatch(comment_read(data.rows))<\/p>\n<p>\u3067\u3001ActionCreator\u3092\u4f5c\u3063\u3066\u3001Reducer\u306bdispatch\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<p>app\/assets\/javascripts\/containers\/CBoardList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport {connect} from &#8220;react-redux&#8221;<br \/>\nimport {board_select, comment_read} from &#8220;..\/actions\/index&#8221;<br \/>\nimport BoardList from &#8220;..\/components\/BoardList&#8221;<\/p>\n<p>const mapStateToProps = (state, ownProps) =>{<br \/>\n  return {<br \/>\n    datas: ownProps.boards,<br \/>\n    selb: state.sel_board<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n    onBoardClick: (id) => {<br \/>\n      dispatch(board_select(id))<\/p>\n<p>      $.ajax({<br \/>\n         type: &#8220;GET&#8221;,<br \/>\n         url: &#8220;\/board\/readComments\/&#8221; + id,<br \/>\n         async: false,<br \/>\n         dataType: &#8220;json&#8221;,<br \/>\n         data: &#8220;name=John&#038;location=Boston&#8221;,<br \/>\n         success: function(data, dataType){<br \/>\n           if (data.status == true){<br \/>\n             \/\/alert(data.rows.length);<br \/>\n             if (data.rows.length > 0){<br \/>\n               dispatch(comment_read(data.rows))<br \/>\n             }<br \/>\n             else{<br \/>\n               dispatch(comment_read([]))<br \/>\n             }<br \/>\n           }<br \/>\n         },<br \/>\n         error :function(XMLHttpRequest, textStatus, errorThrown){<br \/>\n         }<br \/>\n      });<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<h4>routes.rb\u306e\u7de8\u96c6<\/h4>\n<p>config\/routes.rb<br \/>\n[bash]<br \/>\nRails.application.routes.draw do<br \/>\n  get &#8216;board\/index&#8217;<br \/>\n  get &#8216;board\/readComments\/:board_id&#8217; => &#8216;board#readComments&#8217;<\/p>\n<p>  # For details on the DSL available within this file, see http:\/\/guides.rubyonrails.org\/routing.html<br \/>\nend<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8abf\u6574<\/h4>\n<p>app\/controllers\/board_controller.rb<br \/>\n[bash]<br \/>\nclass BoardController < ApplicationController\n  def index\n    @boards = Board.all.order(\"created_at DESC\")\n    @users = User.all.order(\"id\")\n  end\n\n  def readComments\n    response = {status:true}\n\n    recs = Comment.eager_load(:user).where(\"board_id = ?\", params[:board_id])\n            .order(\"comments.created_at DESC\").as_json(include: :user)\n\n    response[\"rows\"] = recs\n\n    render :json=> response<br \/>\n  end<br \/>\nend<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30e2\u30c7\u30eb\u306e\u8abf\u6574<\/h4>\n<p>app\/models\/comment.rb<br \/>\n[bash]<br \/>\nclass Comment < ApplicationRecord\n  belongs_to :user\n\nend\n\n[\/bash]\n\n\n<h4>\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u306e\u30e9\u30c3\u30d1\u30fc\u3001\u672c\u4f53\u306e\u8abf\u6574<\/h4>\n<p>app\/assets\/javascripts\/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    comments: state.comments<br \/>\n  }<br \/>\n}<\/p>\n<p>const CCommentList = connect(mapStateToProps,null)(CommentList)<\/p>\n<p>export default CCommentList<br \/>\n[\/bash]<\/p>\n<p>app\/assets\/javascripts\/components\/CommentList.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport CommentLine from &#8220;.\/CommentLine&#8221;<\/p>\n<p>const CommentList = ({comments}) => {<br \/>\n  let list = []<br \/>\n  comments.map( (c) => {<br \/>\n    list.push(<CommentLine\n      key={c.id}\n      id={c.id}\n      user_id={c.user.id}\n      name={c.user.name}\n      sex={c.user.sex}\n      age={c.user.age}\n      comment={c.comment}\n    \/>)<br \/>\n  })<\/p>\n<p>  return (<\/p>\n<div className=\"clist\">\n      {list}\n    <\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default CommentList<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30b3\u30e1\u30f3\u30c8\u306e1\u884c\u3092\u8868\u3059 CommentLine\u8ffd\u52a0<\/h4>\n<p>app\/assets\/javascripts\/components\/CommentLine.js<br \/>\n[bash]<br \/>\nconst CommentLine = ({user_id, name, age, sex, comment})=> {<br \/>\n  return (<\/p>\n<div className=\"cline\">\n      <label className=\"name\">{name}<\/label><br \/>\n      <label className=\"age\">{age}\u6b73<\/label><br \/>\n      <label className=\"sex\">{sex == 1 ? &#8220;\u7537\u6027&#8221; : &#8220;\u5973\u6027&#8221;}<\/label><\/p>\n<div>\n<div className=\"icon\">\n          <img src={\"..\/images\/hito-\" + user_id + \".jpg\"} \/>\n        <\/div>\n<div className=\"comment\">\n          {comment}\n        <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default CommentLine<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30a2\u30a4\u30b3\u30f3\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc<\/h4>\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 \/>\npublic\/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<h4>\u3053\u3053\u307e\u3067\u3067\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>\u3053\u308c\u3067\u6700\u4f4e\u9650\u306e\u3068\u3053\u308d\u306f\u51fa\u6765\u305f\u306e\u3067\u3001Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n<p>http:\/\/localhost:3000\/board\/index<\/p>\n<p>\u5de6\u5074\u306e\u63b2\u793a\u677f\u304b\u3089\u3069\u308c\u304b\u3092\u9078\u629e\u3057\u305f\u3089\u3001\u53f3\u5074\u306b\u30b3\u30e1\u30f3\u30c8\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-28.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-28-1024x682.png\" alt=\"redux-28\" width=\"806\" height=\"537\" class=\"alignnone size-large wp-image-1442\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-28-1024x682.png 1024w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-28-300x200.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-28-768x512.png 768w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-28.png 1121w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/a><\/p>\n<h3>\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u6a5f\u80fd\u4f5c\u6210<\/h3>\n<p>\u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f\u3059\u308b\u6a5f\u80fd\u3092\u4f5c\u6210\u3059\u308b\u624b\u9806\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h4>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8abf\u6574<\/h4>\n<p>app\/controllers\/board_controller.rb<br \/>\n[bash]<br \/>\nclass BoardController < ApplicationController\n  def index\n    @boards = Board.all.order(\"created_at DESC\")\n    @users = User.all.order(\"id\")\n  end\n\n  def insertComment\n    response = {status:true}\n\n    c = Comment.new({board_id: params[:board_id], user_id: params[:user_id], comment: params[:comment]})\n    c.save()\n\n    render :json=> response<br \/>\n  end<\/p>\n<p>  def readComments<br \/>\n    response = {status:true}<\/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)<\/p>\n<p>    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\u8abf\u6574<\/h4>\n<p>[bash]<br \/>\nRails.application.routes.draw do<br \/>\n  get &#8216;board\/index&#8217;<br \/>\n  post &#8216;board\/insertComment&#8217;<br \/>\n  get &#8216;board\/readComments\/:board_id&#8217; => &#8216;board#readComments&#8217;<\/p>\n<p>  # For details on the DSL available within this file, see http:\/\/guides.rubyonrails.org\/routing.html<br \/>\nend<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u306e\u30e9\u30c3\u30d1\u30fc\u3068\u672c\u4f53\u306e\u8abf\u6574<\/h4>\n<p>app\/assets\/javascripts\/containers\/CCommentAdd.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<br \/>\nimport {connect} from &#8220;react-redux&#8221;<br \/>\nimport CommentAdd from &#8220;..\/components\/CommentAdd&#8221;<br \/>\nimport {comment_add, comment_read} from &#8220;..\/actions\/index&#8221;<\/p>\n<p>const mapStateToProps = (state, ownProps) => {<br \/>\n  return {<br \/>\n    users: ownProps.users,<br \/>\n    sel_board: state.sel_board<br \/>\n  }<br \/>\n}<\/p>\n<p>const mapDispatchToProps = (dispatch) => {<br \/>\n  return {<br \/>\n    onAddComment: (sel_board, user, cmt) => {<br \/>\n      \/\/dispatch(comment_add(cmt))<\/p>\n<p>      var data = {<br \/>\n        board_id: sel_board,<br \/>\n        user_id: user,<br \/>\n        comment: cmt<br \/>\n      };<\/p>\n<p>      $.ajax({<br \/>\n         type: &#8220;POST&#8221;,<br \/>\n         url: &#8220;\/board\/insertComment&#8221;,<br \/>\n         async: false,<br \/>\n         dataType: &#8220;json&#8221;,<br \/>\n         data: data,<br \/>\n         success: function(data, dataType){<br \/>\n           if (data.status == true){<br \/>\n             commentRead(sel_board, dispatch)<br \/>\n           }<br \/>\n         },<br \/>\n         error :function(XMLHttpRequest, textStatus, errorThrown){<br \/>\n         }<br \/>\n      });<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>const commentRead = (sel_board, dispatch) => {<br \/>\n  $.ajax({<br \/>\n     type: &#8220;GET&#8221;,<br \/>\n     url: &#8220;\/board\/readComments\/&#8221; + sel_board,<br \/>\n     async: false,<br \/>\n     dataType: &#8220;json&#8221;,<br \/>\n     data: &#8220;name=John&#038;location=Boston&#8221;,<br \/>\n     success: function(data, dataType){<br \/>\n       if (data.status == true){<br \/>\n         \/\/alert(data.rows.length);<br \/>\n         if (data.rows.length > 0){<br \/>\n           dispatch(comment_read(data.rows))<br \/>\n         }<br \/>\n         else{<br \/>\n           dispatch(comment_read([]))<br \/>\n         }<br \/>\n       }<br \/>\n     },<br \/>\n     error :function(XMLHttpRequest, textStatus, errorThrown){<br \/>\n     }<br \/>\n  });<br \/>\n}<\/p>\n<p>const CCommentAdd = connect(mapStateToProps,mapDispatchToProps)(CommentAdd)<\/p>\n<p>export default CCommentAdd<br \/>\n[\/bash]<\/p>\n<p>app\/assets\/javascripts\/components\/CommentAdd.js<br \/>\n[bash]<br \/>\nimport React from &#8220;react&#8221;<\/p>\n<p>const CommentAdd = ({users, sel_board, onAddComment}) => {<br \/>\n  let ulist = []<br \/>\n  let inpCom,inpUser<\/p>\n<p>  users.map((u) => {<br \/>\n    ulist.push(<option key = {u.id} value={u.id}>{u.name}<\/option>)<br \/>\n  })<\/p>\n<p>  return (<\/p>\n<div className=\"cadd\">\n      <select ref={(node) => {inpUser=node}}><br \/>\n        {ulist}<br \/>\n      <\/select><br \/>\n      <br \/>\n      <textarea rows=\"4\" ref={(node) => {inpCom = node}} \/><br \/>\n      <button onClick={(e) => {<br \/>\n        if (inpCom.value.trim() == &#8220;&#8221;){<br \/>\n          return<br \/>\n        }<\/p>\n<p>        if (sel_board == -1){<br \/>\n          alert(&#8220;\u63b2\u793a\u677f\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044&#8221;)<br \/>\n          return<br \/>\n        }<\/p>\n<p>        onAddComment(sel_board, inpUser.value, inpCom.value)<br \/>\n        inpCom.value = &#8220;&#8221;<br \/>\n      }}>\u6295\u7a3f<\/button>\n    <\/div>\n<p>  )<br \/>\n}<\/p>\n<p>export default CommentAdd<\/p>\n<p>[\/bash]<\/p>\n<h4>\u3053\u3053\u307e\u3067\u3067\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>\u3053\u308c\u3067\u5b8c\u6210\u3067\u3059\u3002Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n<p>http:\/\/localhost:3000\/board\/index<\/p>\n<p>\u5de6\u5074\u306e\u63b2\u793a\u677f\u304b\u3089\u3069\u308c\u304b\u3092\u9078\u629e\u3057\u3001\u53f3\u5074\u306b\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u6b04\u306b\u4f55\u304b\u8a18\u8ff0\u3057\u300c\u6295\u7a3f\u300d\u30dc\u30bf\u30f3\u30af\u30ea\u30c3\u30af\u3067<br \/>\n\u4e00\u89a7\u306b\u8ffd\u52a0\u3055\u308c\u305f\u3089\u6210\u529f\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-29.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-29-1024x778.png\" alt=\"redux-29\" width=\"806\" height=\"612\" class=\"alignnone size-large wp-image-1443\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-29-1024x778.png 1024w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-29-300x228.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-29-768x583.png 768w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2017\/04\/redux-29.png 1061w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/a><\/p>\n<p>\u3053\u3053\u3067\u7d39\u4ecb\u3057\u305f\u30bd\u30fc\u30b9\u306f<a href=\"https:\/\/github.com\/h-mito\/rails_redux_board\">GitHub\u306e\u3053\u3053\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u306e\u3067<\/a>\u81ea\u7531\u306b\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u304a\u75b2\u308c\u3055\u307e\u3067\u3057\u305f\u3002<\/p>\n<h3>\u8ffd\u8a18\u3001GitHub\u30bd\u30fc\u30b9\u306e\u5229\u7528\u65b9\u6cd5<\/h3>\n<h4>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/h4>\n<p>[bash]<br \/>\n$ git clone https:\/\/github.com\/h-mito\/rails_redux_board<br \/>\n$ cd rails_redux_board<br \/>\n$ bundle install<br \/>\n$ npm install<br \/>\n$ rake db:migrate<br \/>\n$ rake db:seed<br \/>\n[\/bash]<\/p>\n<h4>\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n<p>[bash]<br \/>\n$ rails s<br \/>\n[\/bash]<\/p>\n<p><a href=\"http:\/\/localhost:3000\/board\/index\">http:\/\/localhost:3000\/board\/index<\/a><\/p>\n<p>\u4ee5\u4e0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b Redux\u3092\u52c9\u5f37\u3057\u3066\u3001\u3088\u3046\u3084\u304f\u5927\u7b4b\u3092\u7406\u89e3\u3057\u3001Rails\u3068\u306e\u9023\u643a\u65b9\u6cd5\u3082\u5206\u304b\u3063\u305f\u306e\u3067\u3001 Rails\uff0bReact+Redux\uff0bAjax\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u3061\u3087\u3063\u3068\u3057\u305f\u63b2\u793a\u677f\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002 Rails\uff0bReact+Redux\uff0bAjax\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u5fc5\u8981\u306a\u30ce\u30a6\u30cf\u30a6\u306f\u3060\u3044\u305f\u3044\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002 \u3053\u3053\u3067\u7d39\u4ecb\u3059\u308b\u30bd\u30fc\u30b9\u306fGitHub\u306e\u3053\u3053\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u81ea\u7531\u306b\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u5bfe\u8c61\u3068\u3059\u308b\u8aad\u8005\u306f Rails\u306f\u305d\u3053\u305d\u3053\u77e5\u3063\u3066\u3044\u308b\u3002React\u3082\u52c9\u5f37\u3057\u305f\u3002Redux\u3082\u52c9\u5f37\u3057\u305f\u3001\u3082\u3057\u304f\u306f\u52c9\u5f37\u4e2d\u3067\u3042\u308b \u3068\u3044\u3046\u65b9\u304c\u5bfe\u8c61\u3067\u3059\u3002 Rails + React + Redux\u306e\u74b0\u5883\u3092\u6574\u3048\u308b \u3053\u308c\u306b\u95a2\u3057\u3066\u306f\u66f8\u304d\u51fa\u3059\u3068\u9577\u304f\u306a\u308b\u306e\u3067\u3001\u3053\u306e\u8a18\u4e8b\u3092\u53c2\u7167\u3057\u3066\u6e96\u5099\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Todo\u30b5\u30f3\u30d7\u30eb\u3092\u52d5\u304b\u3059\u5fc5\u8981\u306f\u306a\u3044\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a Rails\u3068React\u3068Redux\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u9023\u643a\u306e\u90e8\u5206\u306e\u4f5c\u696d\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002 Rails\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084node.js npm \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u306f\u4ed6\u306b\u5c71\u307b\u3069\u4e01\u5be7\u306b\u66f8\u304b\u308c\u305f\u30b5\u30a4\u30c8\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u63b2\u793a\u677f\u30a2\u30d7\u30ea\u4f5c\u6210\u958b\u59cb \u3055\u3066\u3001\u3044\u3088\u3044\u3088\u63b2\u793a\u677f\u30a2\u30d7\u30ea\u306e\u4f5c\u6210\u958b\u59cb\u3067\u3059\u3002 \u5b8c\u6210\u5f62\u306e\u52d5\u4f5c\u30a4\u30e1\u30fc\u30b8\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002 \u5de6\u306b\u63b2\u793a\u677f\u4e00\u89a7\u304c\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u3066\u3001\u53f3\u306b\u6295\u7a3f\u3092\u884c\u3046\u5834\u6240\u3068\u6295\u7a3f\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u611f\u3058\u3067\u3059\u3002 Rails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210 [bash] $ cd ~\/ $ mkdir workspace $ cd workspace $ rails new rails_redux_board $ cd rails_redux_board [\/bash] \u3053\u308c\u4ee5\u964d\u306e Rails\u3068React\u3001Redux\u306e\u7d44\u307f\u5408\u308f\u305b\u306e\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u624b\u9806\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\uff08Rails5.0 \u306b React\u3001Redux\u3092\u5c0e\u5165\u3057\u3066\u3001Redux\u672c\u5bb6\u306eTodo\u30b5\u30f3\u30d7\u30eb\u3092\u52d5\u304b\u3059\uff09\u3092\u53c2\u7167\u306b\u3057\u3066\u9811\u5f35\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002 \u3068\u308a\u3042\u3048\u305a\u3001Redux\u672c\u5bb6\u306eTodo\u304c\u52d5\u304b\u305b\u305f\u3089OK\u3067\u3059\u3002\u624b\u9593\u3092\u7701\u304d\u305f\u3051\u308c\u3070Todo\u30a2\u30d7\u30ea\u306e\u30b3\u30d4\u30da\u306f\u3057\u306a\u304f\u3066\u7d50\u69cb\u3067\u3059\u3002 components.js\u7de8\u96c6 app\/assets\/javascripts\/components.js board.js\u306f\u30a2\u30d7\u30ea\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u308bJS\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002\u3053\u3053\u306b\u5b9a\u7fa9\u3057\u305f\u30af\u30e9\u30b9\u540d\uff08const\u5ba3\u8a00\uff09\u3092 window\u306e\u4e0b\u306b\u30bb\u30c3\u30c8\uff08\u5909\u6570\u3068\u3057\u3066\u516c\u958b\uff09\u3057\u3066\u3084\u308b\u3002 \uff08\u610f\u5473\u306f\u3044\u307e\u3044\u3061\u7406\u89e3\u3067\u304d\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u5fc5\u9808\u307f\u305f\u3044\u3067\u3059\uff09 \u5168\u3066\u6d88\u3057\u3066\u4ee5\u4e0b\u306e4\u884c\u3092\u8ffd\u8a18\u3002Todo\u30a2\u30d7\u30ea\u3092\u79fb\u690d\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001Todos\u306e\u884c\u306f\u4e0d\u8981 [bash] window.React = require(&#8216;react&#8217;); window.ReactDOM = require(&#8216;react-dom&#8217;); window.Todos = require(&#8216;.\/todos.js&#8217;); window.Board = require(&#8216;.\/board.js&#8217;); [\/bash] React+Redux\u306e\u63b2\u793a\u677f\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u308bJS\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210 app\/assets\/javascripts\/board.js [bash] import React, { Component } from &#8216;react&#8217; import { render } from &#8216;react-dom&#8217; import { Provider } from &#8216;react-redux&#8217; import { createStore } from &#8216;redux&#8217; import rootReducer from &#8216;.\/reducers\/root&#8217; import App from &#8216;.\/components\/App&#8217; const Board = ({}) => { return ( ) } export default Board [\/bash] \u3059\u3079\u3066\u306eReducer\u3092\u307e\u3068\u3081\u308b\u89aaReducer\u4f5c\u6210 app\/assets\/javascripts\/reducers\/root.js [bash] import {combineReducers} from &#8220;redux&#8221; const rootReducer = combineReducers({}) export default rootReducer [\/bash] \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c8\u30c3\u30d7\u968e\u5c64\u3068\u306a\u308bApp.js\u3092\u4f5c\u6210 app\/assets\/javascripts\/components\/App.js [bash] import React from &#8220;react&#8221; const App = ({}) => { return ( This is Board Application with Rails,React,Redux ) } export default App [\/bash] Rails\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3068\u30d3\u30e5\u30fc\u3092\u4f5c\u6210 [bash] $ rails g controller board index [\/bash] \u30d3\u30e5\u30fc\u7de8\u96c6 \u30d3\u30e5\u30fc\u3092\u7de8\u96c6\u3057\u3066\u3001\u63b2\u793a\u677f\u306eReact\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 app\/views\/board\/index.html.erb [bash] Board#index Find me in app\/views\/board\/index.html.erb [\/bash] \u3053\u3053\u307e\u3067\u3067\u52d5\u4f5c\u78ba\u8a8d \u3053\u308c\u3067\u6700\u4f4e\u9650\u306e\u3068\u3053\u308d\u306f\u51fa\u6765\u305f\u306e\u3067\u3001Rails\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u78ba\u8a8d\u3002 http:\/\/localhost:3000\/board\/index \u3053\u3093\u306a\u611f\u3058\u306e\u30a4\u30e1\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\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] \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;&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1428,"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":[1],"tags":[71,72,76],"class_list":{"0":"post-1553","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-1","8":"tag-rails","9":"tag-reactjs","10":"tag-redux"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1553","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=1553"}],"version-history":[{"count":3,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1553\/revisions"}],"predecessor-version":[{"id":1570,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1553\/revisions\/1570"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/media\/1428"}],"wp:attachment":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}