{"id":4480,"date":"2018-06-19T10:43:22","date_gmt":"2018-06-19T01:43:22","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=4480"},"modified":"2023-05-27T23:02:31","modified_gmt":"2023-05-27T14:02:31","slug":"%e3%80%90ruby-on-rails%e3%80%91%e3%81%ae%e3%80%8co-r%e3%83%9e%e3%83%83%e3%83%91%e3%83%bc%e3%80%8d%e3%81%a7%e3%81%82%e3%82%8b%e3%80%8cactiverecord%ef%bc%88%e3%82%a2%e3%82%af%e3%83%86%e3%82%a3%e3%83%96","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=4480","title":{"rendered":"\u3010Ruby on Rails\u3011\u306e\u300cO\/R\u30de\u30c3\u30d1\u30fc\u300d\u3067\u3042\u308b\u300cActiveRecord\uff08\u30a2\u30af\u30c6\u30a3\u30d6\u30ec\u30b3\u30fc\u30c9\uff09\u300d\u3001Scaffolding\u3067\u96db\u5f62\u30a2\u30d7\u30ea\u4f5c\u6210\u307e\u3067"},"content":{"rendered":"<p><span style=\"color: #ff0000;\"><strong>\u300cActiveRecord\uff08\u30a2\u30af\u30c6\u30a3\u30d6\u30ec\u30b3\u30fc\u30c9\uff09\u300d<\/strong><\/span>\u306f\u3001\u300cRuby on Rails\u300d\u304c\u6b63\u5f0f\u306b\u63a1\u7528\u3057\u3066\u3044\u308bO\/R\u30de\u30c3\u30d1\u30fc\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u300cO\/\uff32\u30de\u30c3\u30d1\u30fc\u300d<\/strong><\/span>\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"EK0PzIjmsC\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=1301\">O\/R\u30de\u30c3\u30d1\u30fc\u3068\u306f\uff1f<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=1301&#038;embed=true#?secret=EK0PzIjmsC\" data-secret=\"EK0PzIjmsC\" width=\"500\" height=\"282\" title=\"&#8220;O\/R\u30de\u30c3\u30d1\u30fc\u3068\u306f\uff1f&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u3054\u3068\u306b\u4f5c\u6210\u3057\u305f\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u3092\u901a\u3058\u3066\u3001\u30c6\u30fc\u30d6\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u6a5f\u80fd<\/h2>\n<ul>\n<li>SQL\u3092\u66f8\u304b\u306a\u304f\u3066\u3082\u3001\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u3001\u767b\u9332\u3001\u66f4\u65b0\u3001\u524a\u9664\u304c\u53ef\u80fd<\/li>\n<li>RDBMS\u3092\u300c\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u300d\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u3002<\/li>\n<li>\u30c7\u30fc\u30bf\u3092\u691c\u8a3c\u3067\u304d\u308b\u3002<\/li>\n<\/ul>\n<h2>ActiveRecord\u306e\u30eb\u30fc\u30eb<\/h2>\n<h3>\u30e2\u30c7\u30eb\u30af\u30e9\u30b9<\/h3>\n<ul>\n<li>\u5fc5\u305a<span style=\"color: #ff0000;\"><strong>\u300cActiveRecord::Base\u300d\u30af\u30e9\u30b9<\/strong><\/span>\u3092\u7d99\u627f\u3059\u308b\u3002<\/li>\n<li>\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u540d\u306f\u3001\u5358\u6570\u5f62(\u4f8b\uff1aUser)<\/li>\n<li>\u8907\u6570\u306e\u5358\u8a9e\u3092\u3064\u306a\u3052\u308b\u5834\u5408\u306f\u3001\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\u8a18\u6cd5\u3092\u3059\u308b\u3002(\u4f8b\uff1aUserMaster)<\/li>\n<\/ul>\n<h3>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9<\/h3>\n<ul>\n<li>\u30ec\u30b3\u30fc\u30c9\u3092\u8b58\u5225\u3059\u308b\u305f\u3081\u306e\u30ab\u30e9\u30e0\u540d\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067<span style=\"color: #ff0000;\"><strong>\u300cid\u300d<\/strong><\/span>\u3068\u306a\u308b\u3002\uff08\u7279\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u306a\u304f\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u3002\uff09<\/li>\n<li>\u300ccreated_at\uff1a\u4f5c\u6210\u65e5\u6642\u300d\u3001\u300cupdated_at\uff1a\u66f4\u65b0\u65e5\u6642\u300d\u3068\u3044\u3046\u30ab\u30e9\u30e0\u3082\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u3002<\/li>\n<li>\u30c6\u30fc\u30d6\u30eb\u540d\u306f\u8907\u6570\u5f62(\u4f8b\uff1ausers)<\/li>\n<li>\u8907\u6570\u306e\u5358\u8a9e\u3092\u3064\u306a\u3052\u308b\u5834\u5408\u306f\u3001\u30b9\u30cd\u30fc\u30af\u30b1\u30fc\u30b9\u8a18\u6cd5\u3092\u3059\u308b\u3002\uff08\u4f8b\uff1auser_master\uff09<\/li>\n<\/ul>\n<h2>\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h2>\n<h3>1.\u300c\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u300d\u3092\u4f5c\u308b\u3002<\/h3>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">rails g model \u30e2\u30c7\u30eb\u540d \u30ab\u30e9\u30e0\u540d1:\u30c7\u30fc\u30bf\u578b1 \u30ab\u30e9\u30e0\u540d2:\u30c7\u30fc\u30bf\u578b2<\/pre>\n<h4>\u6307\u5b9a\u3067\u304d\u308b\u30c7\u30fc\u30bf\u578b\u306e\u7a2e\u985e<\/h4>\n<table>\n<tbody>\n<tr>\n<th>\u7a2e\u985e<\/th>\n<th>\u8aac\u660e<\/th>\n<th>SQLite\u306e\u30c7\u30fc\u30bf\u578b<\/th>\n<\/tr>\n<tr>\n<td>integer<\/td>\n<td>\u6574\u6570<\/td>\n<td>integer<\/td>\n<\/tr>\n<tr>\n<td>float<\/td>\n<td>\u5c0f\u6570<\/td>\n<td>real<\/td>\n<\/tr>\n<tr>\n<td>string<\/td>\n<td>\u56fa\u5b9a\u9577\u6587\u5b57\u5217<\/td>\n<td>varchar<\/td>\n<\/tr>\n<tr>\n<td>text<\/td>\n<td>\u56fa\u5b9a\u9577\u3067\u306a\u3044\u6587\u5b57\u5217<\/td>\n<td>text<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u4f8b\uff1aUser\u3068\u3044\u3046\u300c\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u300d\u3092\u4f5c\u308a\u307e\u3059\u3002<\/h4>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4489\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30e2\u30c7\u30eb\u306e\u4f5c\u6210.png\" alt=\"\" width=\"476\" height=\"148\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30e2\u30c7\u30eb\u306e\u4f5c\u6210.png 476w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30e2\u30c7\u30eb\u306e\u4f5c\u6210-300x93.png 300w\" sizes=\"(max-width: 476px) 100vw, 476px\" \/><\/p>\n<p>\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u4ee5\u5916\u306b\u3082\u3001\u8272\u3005\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u4f5c\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>db\/migrate\/20180619102840_create_users.rb<\/td>\n<td>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3001\u4f5c\u6210\u65e5\u6642\u304c\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u5148\u982d\u306b\u4ed8\u304f\u3002<\/td>\n<\/tr>\n<tr>\n<td>app\/models\/user.rb<\/td>\n<td><span style=\"color: #ff0000;\"><strong>\u300c\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u300d\u3001\u3053\u306e\u30af\u30e9\u30b9\u3092\u901a\u3058\u3066Rails\u306f\u30c6\u30fc\u30d6\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td>test\/models\/user_test.rb<\/td>\n<td>\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306e\u96db\u5f62<\/td>\n<\/tr>\n<tr>\n<td>test\/fixtures\/users.<span style=\"color: #ff0000;\"><strong>yml<\/strong><\/span><\/td>\n<td><span style=\"color: #ff0000;\"><strong>\u300c\u30d5\u30a3\u30af\u30b9\u30c1\u30e3\u300d<\/strong><\/span>\u3068\u3044\u3046\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u4f5c\u308b\u305f\u3081\u306e\u96db\u5f62<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3068\u306f\uff1f<\/h4>\n<p>Rails\u3067\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u3084\u4fee\u6b63\u306b\u4f7f\u7528\u3059\u308b\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067<span style=\"color: #ff0000;\"><strong>\u30c6\u30fc\u30d6\u30eb\u306e\u4fdd\u5b88\u4f5c\u696d\u3092\u534a\u81ea\u52d5\u5316<\/strong><\/span>\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3068\u306f\uff1f<\/strong><\/p>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3001\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<h3>2.\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066DB\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h3>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">rails db:migrate<\/pre>\n<h4>\u5b9f\u884c\u4f8b<\/h4>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4491\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3_\u5b9f\u884c\u4f8b.png\" alt=\"\" width=\"659\" height=\"117\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3_\u5b9f\u884c\u4f8b.png 659w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3_\u5b9f\u884c\u4f8b-300x53.png 300w\" sizes=\"(max-width: 659px) 100vw, 659px\" \/><\/p>\n<h3>3.DB(SQLite)\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/h3>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">rails dbconsole<\/pre>\n<h4>\u5b9f\u884c\u4f8b<\/h4>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4492\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/sqlite\u63a5\u7d9a.png\" alt=\"\" width=\"392\" height=\"96\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/sqlite\u63a5\u7d9a.png 392w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/sqlite\u63a5\u7d9a-300x73.png 300w\" sizes=\"(max-width: 392px) 100vw, 392px\" \/><\/p>\n<h3>4\uff0e\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4493\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3002.png\" alt=\"\" width=\"920\" height=\"120\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3002.png 920w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3002-300x39.png 300w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3002-768x100.png 768w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/p>\n<h4>\u78ba\u8a8d\u30b3\u30de\u30f3\u30c9<\/h4>\n<table>\n<tbody>\n<tr>\n<th>\u30b3\u30de\u30f3\u30c9<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>.tables<\/td>\n<td>\u73fe\u5728\u3001\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u78ba\u8a8d\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9<\/td>\n<\/tr>\n<tr>\n<td>.schema \u30c6\u30fc\u30d6\u30eb\u540d<\/td>\n<td>\u30c6\u30fc\u30d6\u30eb\u306e\u30ab\u30e9\u30e0\u3092\u78ba\u8a8d\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h2>\n<h3>1.\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306e\u6e96\u5099<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u300c\u30d5\u30a3\u30af\u30b9\u30c1\u30e3\u300d<\/strong><\/span>\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u300c\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u300d\u3092\u4f5c\u6210\u3057\u305f\u969b\u306b\u3001\u4e0b\u8a18\u306e\u5834\u6240\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>test\/fixtures\/users.<span style=\"color: #ff0000;\"><strong>yml<\/strong><\/span><\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u65e2\u306b2\u30ec\u30b3\u30fc\u30c9\u3001\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\"># Read about fixtures at http:\/\/api.rubyonrails.org\/classes\/ActiveRecord\/FixtureSet.html\r\n\r\none:\r\n  name: MyText\r\n\r\ntwo:\r\n  name: MyText<\/pre>\n<p>\u308f\u304b\u308a\u3084\u3059\u3044\u3088\u3046\u306b\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\"># Read about fixtures at http:\/\/api.rubyonrails.org\/classes\/ActiveRecord\/FixtureSet.html\r\n\r\none:\r\n  name: \u592a\u90ce\r\n\r\ntwo:\r\n  name: \u82b1\u5b50<\/pre>\n<h3>2.\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u8fbc\u3080\u3002<\/h3>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">rails db:fixtures:load<\/pre>\n<h4>3.\u53d6\u308a\u8fbc\u307e\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002<\/h4>\n<pre class=\"lang:default decode:true \">[root@localhost fixtures]# rails dbconsole\r\nSQLite version 3.6.20\r\nEnter \".help\" for instructions\r\nEnter SQL statements terminated with a \";\"\r\nsqlite&gt;\r\nsqlite&gt; select * from users;\r\n298486374|\u82b1\u5b50|2018-06-19 11:02:02.567463|2018-06-19 11:02:02.567463\r\n980190962|\u592a\u90ce|2018-06-19 11:02:02.567463|2018-06-19 11:02:02.567463\r\nsqlite&gt;<\/pre>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u3001dbconsole\u306b\u3066SQL\u3092\u767a\u884c\u3057\u3066\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<h2>\u30c6\u30b9\u30c8\uff1aScaffolding(\u30b9\u30ad\u30e3\u30d5\u30a9\u30fc\u30eb\u30c7\u30a3\u30f3\u30b0)\u3068\u306f\uff1f<\/h2>\n<p>Rails\u306e<span style=\"color: #ff0000;\"><strong>\u30a2\u30d7\u30ea\u306e\u96db\u5f62\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<p>\u5c02\u7528\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u306e\u53c2\u7167\u3001\u767b\u9332\u3001\u66f4\u65b0\u3001\u524a\u9664\u3059\u308b\u305f\u3081\u306e\u753b\u9762\u304c\u305d\u308c\u305e\u308c\u81ea\u52d5\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>\u30b3\u30de\u30f3\u30c9<\/h3>\n<pre class=\"lang:default decode:true\">rails g scaffold \u30ea\u30bd\u30fc\u30b9\u540d \u30ab\u30e9\u30e0\u540d1:\u30c7\u30fc\u30bf\u578b1 \u30ab\u30e9\u30e0\u540d2:\u30c7\u30fc\u30bf\u578b2<\/pre>\n<p>\u300c\u30ea\u30bd\u30fc\u30b9\u540d\u300d\u306f\u3001\u4f5c\u6210\u3057\u305f\u300c\u30c6\u30fc\u30d6\u30eb\u540d\u300d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u3060\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u4f5c\u6210\u3057\u3066\u304b\u3089\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002(<span style=\"color: #ff0000;\"><strong>\u306a\u304a\u3001Rails6\u3067\u306f\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306e\u4f5c\u6210\u307e\u3067\u81ea\u52d5\u3067\u884c\u3063\u3066\u304f\u308c\u308b\u3088\u3046\u306a\u306e\u3067\u3044\u304d\u306a\u308a\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\u3001\u9006\u306b\u4f5c\u3063\u3066\u3057\u307e\u3046\u3068scaffold\u30b3\u30de\u30f3\u30c9\u3067\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3001\u305d\u306e\u5f8c\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u306b\u3088\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u306f\u5fc5\u8981\u3067\u3059\u3002<\/strong><\/span>\uff09<\/p>\n<h3>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u4f8b<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4502\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u5b9f\u884c\u4f8b.png\" alt=\"\" width=\"786\" height=\"671\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u5b9f\u884c\u4f8b.png 786w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u5b9f\u884c\u4f8b-300x256.png 300w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u5b9f\u884c\u4f8b-768x656.png 768w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/p>\n<p>\u4e0b\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u751f\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>app\/controllers\/users_controller.rb<\/td>\n<td>\u30a2\u30d7\u30ea\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u4ed8\u3051\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9<\/td>\n<\/tr>\n<tr>\n<td>app\/views\/users\/index.html.erb<\/td>\n<td>\u4e00\u89a7\u753b\u9762<\/td>\n<\/tr>\n<tr>\n<td>app\/views\/users\/edit.html.erb<\/td>\n<td>\u7de8\u96c6\u753b\u9762<\/td>\n<\/tr>\n<tr>\n<td>app\/views\/users\/show.html.erb<\/td>\n<td>\u8868\u793a\u753b\u9762<\/td>\n<\/tr>\n<tr>\n<td>app\/views\/users\/new.html.erb<\/td>\n<td>\u767b\u9332\u753b\u9762<\/td>\n<\/tr>\n<tr>\n<td>app\/views\/users\/_form.html.erb<\/td>\n<td>\u7de8\u96c6\u3001\u767b\u9332\u5171\u901a\u753b\u9762<\/td>\n<\/tr>\n<tr>\n<td>app\/assets\/stylesheets\/scaffolds.scss<\/td>\n<td>Scaffolding\u7528\u306e\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u307e\u305f\u3001<span style=\"color: #ff0000;\"><strong>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\u3082\u81ea\u52d5\u3067\u4fee\u6b63\u3057\u3066\u304f\u308c\u308b<\/strong><\/span>\u306e\u3067\u3001\u73fe\u72b6\u3067\u65e2\u306b\u30a2\u30d7\u30ea\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30a2\u30d7\u30ea\u3092\u8d77\u52d5\u3057\u3066\u307f\u308b\u3002<\/h3>\n<h4>\u4e00\u89a7\u753b\u9762<\/h4>\n<p>http:\/\/192.168.10.5:3000\/users(\u30ea\u30bd\u30fc\u30b9\u540d)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4509\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u4e00\u89a7\u753b\u9762.png\" alt=\"\" width=\"346\" height=\"235\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u4e00\u89a7\u753b\u9762.png 346w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u4e00\u89a7\u753b\u9762-300x204.png 300w\" sizes=\"(max-width: 346px) 100vw, 346px\" \/><\/p>\n<h4>\u767b\u9332\u753b\u9762<\/h4>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4508\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u767b\u9332\u753b\u9762.png\" alt=\"\" width=\"361\" height=\"223\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u767b\u9332\u753b\u9762.png 361w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u767b\u9332\u753b\u9762-300x185.png 300w\" sizes=\"(max-width: 361px) 100vw, 361px\" \/><\/p>\n<h4>\u7de8\u96c6\u753b\u9762<\/h4>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4506\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u7de8\u96c6\u753b\u9762.png\" alt=\"\" width=\"431\" height=\"232\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u7de8\u96c6\u753b\u9762.png 431w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u7de8\u96c6\u753b\u9762-300x161.png 300w\" sizes=\"(max-width: 431px) 100vw, 431px\" \/><\/p>\n<h4>\u8868\u793a\u753b\u9762<\/h4>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4507\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u8868\u793a\u753b\u9762.png\" alt=\"\" width=\"402\" height=\"174\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u8868\u793a\u753b\u9762.png 402w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/\u8868\u793a\u753b\u9762-300x130.png 300w\" sizes=\"(max-width: 402px) 100vw, 402px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"\u300cActiveRecord\uff08\u30a2\u30af\u30c6\u30a3\u30d6\u30ec\u30b3\u30fc\u30c9\uff09\u300d\u306f\u3001\u300cRuby on Rails\u300d\u304c\u6b63\u5f0f\u306b\u63a1\u7528\u3057\u3066\u3044\u308bO\/R\u30de\u30c3\u30d1\u30fc\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306a\u308a\u307e\u3059\u3002 \u300cO\/\uff32\u30de\u30c3\u30d1\u30fc\u300d\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002 O\/R\u30de\u30c3\u30d1\u30fc\u3068 [&hellip;]","protected":false},"author":1,"featured_media":4265,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[36],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4480"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4480"}],"version-history":[{"count":19,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4480\/revisions"}],"predecessor-version":[{"id":20552,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4480\/revisions\/20552"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/4265"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4480"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}