{"id":5081,"date":"2018-06-23T23:37:52","date_gmt":"2018-06-23T14:37:52","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=5081"},"modified":"2023-05-27T23:01:17","modified_gmt":"2023-05-27T14:01:17","slug":"%e3%80%90ruby-on-rails%e3%80%91%e3%80%8cscaffolding%e3%82%b9%e3%82%ad%e3%83%a3%e3%83%95%e3%82%a9%e3%83%bc%e3%83%ab%e3%83%87%e3%82%a3%e3%83%b3%e3%82%b0%e3%80%8d%e3%81%a7%e8%87%aa%e5%8b%95%e7%94%9f","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=5081","title":{"rendered":"\u3010Ruby on Rails\u3011\u300cScaffolding(\u30b9\u30ad\u30e3\u30d5\u30a9\u30fc\u30eb\u30c7\u30a3\u30f3\u30b0)\u300d\u751f\u6210\u3055\u308c\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3001jbuilder"},"content":{"rendered":"<p>Ruby on Rails\u306e<span style=\"color: #ff0000;\"><strong>\u300cScaffolding(\u30b9\u30ad\u30e3\u30d5\u30a9\u30fc\u30eb\u30c7\u30a3\u30f3\u30b0)\u300d<\/strong><\/span>\u3068\u3044\u3046\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308c\u3070\u3001\u30a2\u30d7\u30ea\u306e\u96db\u5f62\u3092\u81ea\u52d5\u751f\u6210\u3067\u304d\u308b\u3068\u3054\u7d39\u4ecb\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"NexGCcxX4y\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=4480\">\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<\/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=4480&#038;embed=true#?secret=NexGCcxX4y\" data-secret=\"NexGCcxX4y\" width=\"500\" height=\"282\" title=\"&#8220;\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&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h2>\u4e00\u89a7\u753b\u9762\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u898b\u3066\u307f\u308b\u3002<\/h2>\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<h3>app\/controllers\/users_controller.rb<\/h3>\n<p>\u4e00\u89a7\u753b\u9762\u306b\u5bfe\u5fdc\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3\u3068\u3057\u3066\u306f\u3001\u4e0b\u8a18\u306e<span style=\"color: #ff0000;\"><strong>index\u30a2\u30af\u30b7\u30e7\u30f3<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">class UsersController &lt; ApplicationController\r\n  before_action :set_user, only: [:show, :edit, :update, :destroy]\r\n\r\n  # GET \/users\r\n  # GET \/users.json\r\n  def index\r\n    @users = User.all\r\n  end\r\n\u2026\r\nend<\/pre>\n<p>Users\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306eall\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570<span style=\"color: #ff0000;\"><strong>\u300c@users\u300d<\/strong><\/span>\u306b\u683c\u7d0d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>app\/views\/users\/index.html.erb<\/h3>\n<p>\u4e00\u89a7\u306b\u5bfe\u5fdc\u3059\u308b\u30d3\u30e5\u30fc\u3068\u3057\u3066\u306f\u3001\u3053\u3061\u3089\u306e\u30d3\u30e5\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">&lt;p id=\"notice\"&gt;&lt;%= notice %&gt;&lt;\/p&gt;\r\n\r\n&lt;h1&gt;Users&lt;\/h1&gt;\r\n\r\n&lt;table&gt;\r\n  &lt;thead&gt;\r\n    &lt;tr&gt;\r\n      &lt;th&gt;Name&lt;\/th&gt;\r\n      &lt;th colspan=\"3\"&gt;&lt;\/th&gt;\r\n    &lt;\/tr&gt;\r\n  &lt;\/thead&gt;\r\n\r\n  &lt;tbody&gt;\r\n    &lt;% @users.each do |user| %&gt;\r\n      &lt;tr&gt;\r\n        &lt;td&gt;&lt;%= user.name %&gt;&lt;\/td&gt;\r\n        &lt;td&gt;&lt;%= link_to 'Show', user %&gt;&lt;\/td&gt;\r\n        &lt;td&gt;&lt;%= link_to 'Edit', edit_user_path(user) %&gt;&lt;\/td&gt;\r\n        &lt;td&gt;&lt;%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %&gt;&lt;\/td&gt;\r\n      &lt;\/tr&gt;\r\n    &lt;% end %&gt;\r\n  &lt;\/tbody&gt;\r\n&lt;\/table&gt;\r\n\r\n&lt;br&gt;\r\n\r\n&lt;%= link_to 'New User', new_user_path %&gt;<\/pre>\n<h4>&lt;p id=\"notice\"&gt;&lt;%= notice %&gt;&lt;\/p&gt;<\/h4>\n<p><span style=\"color: #ff0000;\"><strong>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u51e6\u7406\u7d50\u679c\u3092\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u901a\u77e5\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u308f\u308c\u308b\u5909\u6570<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h4>\u300c&lt;% @users.each do |user| %&gt;\u3000\u2026\u00a0 &lt;% end %&gt;\u300d\u306e\u30d6\u30ed\u30c3\u30af<\/h4>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u304b\u3089\u53d6\u308a\u51fa\u3057\u305f\u5024\u3092\u30eb\u30fc\u30d7\u3067\u53d6\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4>\u300c&lt;%= link_to\u300d\u304b\u3089\u59cb\u307e\u308b\u5185\u5bb9<\/h4>\n<p><span style=\"color: #ff0000;\"><strong>\u300clink_to\u300d\u306f\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\uff08\u30d3\u30e5\u30fc\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u5171\u901a\u3067\u547c\u3073\u51fa\u305b\u308b\u30e1\u30bd\u30c3\u30c9\uff09<\/strong><\/span>\u3067\u3001\u30ea\u30f3\u30af\u3067\u3042\u308ba\u30bf\u30b0\u3092HTML\u306b\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">link_to \u30ea\u30f3\u30af\u540d,\u30ea\u30f3\u30af\u5148<\/pre>\n<p><strong>link_to\u30e1\u30bd\u30c3\u30c9\u3067\u4f7f\u3048\u308b\u5f15\u6570<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<th>\u5f15\u6570<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>\u30ea\u30f3\u30af\u540d<\/td>\n<td>a\u30bf\u30b0\u3067\u56f2\u3080\u30c6\u30ad\u30b9\u30c8\u540d<\/td>\n<\/tr>\n<tr>\n<td>\u30ea\u30f3\u30af\u5148<\/td>\n<td>\u30ea\u30f3\u30af\u5148\u306eURL<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>link_to\u30e1\u30bd\u30c3\u30c9\u3067\u6307\u5b9a\u3067\u304d\u308b\u30ea\u30f3\u30af\u5148\u306b\u3064\u3044\u3066<\/h3>\n<p>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u51fa\u529b\u3055\u308c\u3066\u3044\u305fPrefix\u306b\u300c_path\u300d\u3092\u3064\u3051\u305f\u5f62\u5f0f\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u30e1\u30bd\u30c3\u30c9\u3067\u6307\u5b9a\u3067\u304d\u308b\u30ea\u30f3\u30af\u5148\u306eURL\u306b\u5909\u63db\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u60c5\u5831\u53ca\u3073\u3001Prefix<\/strong><\/span>\u306f\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">rails routes<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5088\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_routes_Prefix.png\" alt=\"\" width=\"522\" height=\"192\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_routes_Prefix.png 522w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/rails_routes_Prefix-300x110.png 300w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/p>\n<h2>\u8868\u793a\u753b\u9762<\/h2>\n<p>URL\u3068\u3057\u3066\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300chttp:\/\/IP\u30a2\u30c9\u30ec\u30b9:\u30dd\u30fc\u30c8\u756a\u53f7\/\u30a2\u30af\u30b7\u30e7\u30f3\u540d\/ID\u300d<\/strong><\/span>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u969b\u306b\u8868\u793a\u3055\u308c\u308b\u753b\u9762\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5093\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/Rails_\u8868\u793a\u753b\u9762.png\" alt=\"\" width=\"454\" height=\"216\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/Rails_\u8868\u793a\u753b\u9762.png 454w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/Rails_\u8868\u793a\u753b\u9762-300x143.png 300w\" sizes=\"(max-width: 454px) 100vw, 454px\" \/><\/p>\n<p>\u307e\u305a\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u51e6\u7406\u304b\u3089\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\uff08app\/controllers\/users_controller.rb\uff09<\/h3>\n<p>\u307e\u305a\u3001\u7740\u76ee\u3059\u308b\u306e\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300cbefore_action\u300d<\/strong><\/span>\u304b\u3089\u59cb\u307e\u308b\u4e0b\u8a18\u306e\u8a18\u8ff0\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">class UsersController &lt; ApplicationController\r\n  before_action :set_user, only: [:show, :edit, :update, :destroy]\r\n\u3000\u2026\r\nend<\/pre>\n<p>\u7d50\u8ad6\u304b\u3089\u8a00\u3048\u3070\u3001\u4e0a\u8a18\u69cb\u6587\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300cshow(\u8868\u793a\u753b\u9762)\u3001edit(\u7de8\u96c6\u753b\u9762)\u3001update(\u66f4\u65b0\u753b\u9762)\u3001destroy(\u524a\u9664\u753b\u9762)\u300d\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u969b\u306b\u3001\u4e8b\u524d\u51e6\u7406\u3068\u3057\u3066\u300cset_user\u30e1\u30bd\u30c3\u30c9\u300d\u3092\u5b9f\u884c\u3059\u308b<\/strong><\/span>\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u8868\u793a\u753b\u9762\u306e\u89e3\u8aac\u306b\u306a\u308b\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u300cset_user\u30e1\u30bd\u30c3\u30c9\u300d<\/strong><\/span>\u304c\u547c\u3073\u51fa\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u8a73\u3057\u3044\u69cb\u6587\u306e\u610f\u5473\u306f\u3001\u4e0b\u8a18\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>before_action\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u547c\u3076\u524d\u306b\u7279\u5b9a\u306e\u51e6\u7406\u3092\u3055\u305b\u305f\u3044\u5834\u5408\u306b\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u300d<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">before_action \u30e1\u30bd\u30c3\u30c9\u540d,\u6761\u4ef6\u30cf\u30c3\u30b7\u30e5<\/pre>\n<p><strong>\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306e\u8aac\u660e<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<th>\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>\u30e1\u30bd\u30c3\u30c9\u540d<\/td>\n<td>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u5185\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u30b7\u30f3\u30dc\u30eb\u3068\u3057\u3066\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u6761\u4ef6\u30cf\u30c3\u30b7\u30e5<\/td>\n<td>\u9069\u7528\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u6761\u4ef6\u3092\u30cf\u30c3\u30b7\u30e5\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u6761\u4ef6\u30cf\u30c3\u30b7\u30e5\u306e\u69cb\u6587<\/strong><\/p>\n<pre class=\"lang:default decode:true\">(only\/except):[\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u30b7\u30f3\u30dc\u30eb1,\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u30b7\u30f3\u30dc\u30eb2,\u2026]<\/pre>\n<p><strong>\u00a0only<\/strong><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u6307\u5b9a\u3057\u305f\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u307f<\/strong><\/span>\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><strong>except<\/strong><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u6307\u5b9a\u3057\u305f\u30a2\u30af\u30b7\u30e7\u30f3\u4ee5\u5916<\/strong><strong>\u306e\u5168\u3066\u306e\u30a2\u30af\u30b7\u30e7\u30f3<\/strong><\/span>\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>show\u30a2\u30af\u30b7\u30e7\u30f3<\/h3>\n<p>\u8868\u793a\u753b\u9762\u306f\u3001\u4e0b\u8a18\u306e\u300cshow\u30a2\u30af\u30b7\u30e7\u30f3\u300d\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">  # GET \/users\/1\r\n  # GET \/users\/1.json\r\n  def show\r\n  end<\/pre>\n<p>\u305f\u3060\u3057\u3001\u898b\u3066\u5206\u304b\u308b\u3068\u304a\u308a<span style=\"color: #ff0000;\"><strong>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u4f55\u3082\u4e2d\u8eab\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/strong><\/span><\/p>\n<p>\u3067\u306f\u3001\u753b\u9762\u306b\u8868\u793a\u3055\u305b\u308b\u5185\u5bb9\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300cset_user\u30e1\u30bd\u30c3\u30c9\u300d<\/strong><\/span>\u3067\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u3002<\/p>\n<h3>set_user(\u30a2\u30af\u30b7\u30e7\u30f3\u540d)\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>show\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u547c\u3070\u308c\u308b\u524d\u306e\u4e8b\u524d\u51e6\u7406<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">  private\r\n    # Use callbacks to share common setup or constraints between actions.\r\n    def set_user\r\n      @user = User.find(params[:id])\r\n    end\r\n    \u2026\r\n  end<\/pre>\n<p>\u3053\u3053\u3067\u306f\u3001\u753b\u9762\u306e\u8868\u793a\u3055\u305b\u3066\u3044\u308bURL\u306e\uff29\uff24\u306e\u5024\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3001<span style=\"color: #ff0000;\"><strong>\u300c@user\u5909\u6570\u300d<\/strong><\/span>\u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">User.find(params[:id])<\/pre>\n<p>\u300cparams[:id]\u300d\u3068\u3044\u3046\u306e\u306f\u3001\u300chttp:\/\/192.168.10.5:3000\/users\/298486374\u300d\u3068\u3044\u3046URL\u3067\u8a00\u3048\u3070\u3001\u300c298486374\u300d\u306e\u90e8\u5206\u3092\u53d6\u308a\u51fa\u3059\u69cb\u6587(HTTP\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3059\u69cb\u6587)\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\uff35\uff32\uff2c\u306e\u3069\u306e\u90e8\u5206\u3092\u3001\u53d6\u308a\u51fa\u3059\u304b\u306f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u60c5\u5831\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5098\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/before_action.png\" alt=\"\" width=\"409\" height=\"199\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/before_action.png 409w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/06\/before_action-300x146.png 300w\" sizes=\"(max-width: 409px) 100vw, 409px\" \/><\/p>\n<h3>\u30d3\u30e5\u30fc\uff08app\/views\/users\/show.html.erb\uff09<\/h3>\n<pre class=\"lang:default decode:true\">&lt;p id=\"notice\"&gt;&lt;%= notice %&gt;&lt;\/p&gt;\r\n\r\n&lt;p&gt;\r\n  &lt;strong&gt;Name:&lt;\/strong&gt;\r\n  &lt;%= @user.name %&gt;\r\n&lt;\/p&gt;\r\n\r\n&lt;%= link_to 'Edit', edit_user_path(@user) %&gt; |\r\n&lt;%= link_to 'Back', users_path %&gt;<\/pre>\n<p>\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u5185\u5bb9\u306f\u3001\u307b\u307c\u4e00\u89a7\u753b\u9762\u3067\u51fa\u529b\u3057\u3066\u3044\u308b\u5185\u5bb9\u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>\u3057\u3044\u3066\u8a00\u3048\u3070\u3001\u753b\u9762\u8868\u793a\u306b\u4e8b\u524d\u51e6\u7406\u306e\u300cset_user(\u30a2\u30af\u30b7\u30e7\u30f3\u540d)\u30e1\u30bd\u30c3\u30c9\u300d\u3067\u4ee3\u5165\u3057\u305f<span style=\"color: #ff0000;\"><strong>\u300c@user\u300d<\/strong><\/span>\u3092\u4f7f\u3063\u3066\u3044\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2>\u767b\u9332\u753b\u9762<\/h2>\n<p>\u300cScaffolding\u300d\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u4e0b\u8a18\u306e<span style=\"color: #ff0000;\"><strong>\u300c\u767b\u9332\u753b\u9762\u300d\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/strong><\/span>\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\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<h3>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9(app\/controllers\/users_controller.rb)<\/h3>\n<p>\u767b\u9332\u753b\u9762\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3068\u306a\u308b\u306e\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300cnew\u30a2\u30af\u30b7\u30e7\u30f3\u300d<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">class UsersController &lt; ApplicationController\r\n  before_action :set_user, only: [:show, :edit, :update, :destroy]\r\n\u3000\u2026\r\n\u3000  # GET \/users\/new\r\n  def new\r\n    @user = User.new\r\n  end\r\n\u3000\u2026\r\nend<\/pre>\n<h4>@user = User.new<\/h4>\n<p>User\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306enew\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\u3066\u3001<span style=\"color: #ff0000;\"><strong>\u300c@user\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u300d<\/strong><\/span>\u306b\u683c\u7d0d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30d3\u30e5\u30fc(app\/views\/users\/new.html.erb)<\/h3>\n<pre class=\"lang:default decode:true\">&lt;h1&gt;New User&lt;\/h1&gt;\r\n\r\n&lt;%= render 'form', user: @user %&gt;\r\n\r\n&lt;%= link_to 'Back', users_path %&gt;<\/pre>\n<h4>&lt;%= render 'form', user: @user %&gt;<\/h4>\n<p>\u4e0b\u8a18\u306e\u69cb\u6587\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">&lt;%= render \u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u540d, \u30ad\u30fc\uff11: \u5024\uff11,\u30ad\u30fc2:\u50242 %&gt;<\/pre>\n<h4>\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/h4>\n<p><span style=\"color: #ff0000;\"><strong>\u30d3\u30e5\u30fc\u304b\u3089\u5207\u308a\u51fa\u3055\u308c\u305f\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb<\/strong><\/span>\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u767b\u9332\u753b\u9762\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306e\u90e8\u54c1\u5185\u5bb9\u3092\u3001<span style=\"color: #ff0000;\"><strong>\u5404\u753b\u9762\u306e\u5171\u901a\u51e6\u7406\u3068\u3057\u3066\u4f7f\u3044\u307e\u308f\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u30e1\u30ea\u30c3\u30c8<\/strong><\/span>\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u767b\u9332\u753b\u9762\u3067\u547c\u3073\u3055\u308c\u308b\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u3057\u3066\u306f\u3001\u4e0b\u8a18\u306e\u30d1\u30b9\u306b\u3042\u308b\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div class=\"graybox\">app\/views\/users\/_form.html.erb<\/div>\n<div><\/div>\n<p>\u307e\u305f\u3001\u7b2c\u4e8c\u5f15\u6570\u3067\u6307\u5b9a\u3057\u3066\u3044\u308b<span style=\"color: #ff0000;\"><strong>\u300c\u30ad\u30fc\uff1a\u5024\u300d<\/strong><\/span>\u306e\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8(_form.html.erb)\u300d\u306e\u4e2d\u306b\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u30e1\u30bd\u30c3\u30c9\u3067\u7528\u610f\u3055\u308c\u305f@user(User\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9)\u306buser\u5909\u6570\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b<\/strong><\/span>\u3068\u3044\u3046\u3053\u3068\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div><\/div>\n<h3>&lt;%= link_to 'Back', users_path %&gt;<\/h3>\n<p>\u4e00\u89a7\u753b\u9762\u3078\u306e\u30ea\u30f3\u30af\u306e\u4f5c\u6210\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8(app\/views\/users\/_form.html.erb)<\/h2>\n<p>\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u4ed6\u306e\u753b\u9762\u304b\u3089\u5171\u901a\u51e6\u7406\u3068\u3057\u3066\u547c\u3073\u51fa\u3055\u308c\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>new.html.erb\u304b\u3089\u5171\u901a\u306e\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u3057\u3066\u547c\u3073\u51fa\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">&lt;%= form_with(model: user, local: true) do |form| %&gt;\r\n  &lt;% if user.errors.any? %&gt;\r\n    &lt;div id=\"error_explanation\"&gt;\r\n      &lt;h2&gt;&lt;%= pluralize(user.errors.count, \"error\") %&gt; prohibited this user from being saved:&lt;\/h2&gt;\r\n\r\n      &lt;ul&gt;\r\n      &lt;% user.errors.full_messages.each do |message| %&gt;\r\n        &lt;li&gt;&lt;%= message %&gt;&lt;\/li&gt;\r\n      &lt;% end %&gt;\r\n      &lt;\/ul&gt;\r\n    &lt;\/div&gt;\r\n  &lt;% end %&gt;\r\n\r\n  &lt;div class=\"field\"&gt;\r\n    &lt;%= form.label :name %&gt;\r\n    &lt;%= form.text_area :name %&gt;\r\n  &lt;\/div&gt;\r\n\r\n  &lt;div class=\"actions\"&gt;\r\n    &lt;%= form.submit %&gt;\r\n  &lt;\/div&gt;\r\n&lt;% end %&gt;<\/pre>\n<h3>form_with\u30d3\u30e5\u30fc\u30d8\u30eb\u30d1\u30fc\uff08&lt;%= form_with(model: user, local: true) do |form| %&gt;\u3000\uff5e\u3000&lt;% end %&gt;\uff09<\/h3>\n<p>\u5f15\u6570\u306e\u5f62\u5f0f\u306b\u3088\u3063\u3066\u69d8\u3005\u306aform\u30bf\u30b0\u3092\u51fa\u529b\u3059\u308b<span style=\"color: #ff0000;\"><strong>\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<p>\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u3068\u306f\u3001\u30d3\u30e5\u30fc\u3084\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u5171\u901a\u3057\u3066\u547c\u3073\u51fa\u3055\u308c\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">&lt;%= form_with(model: \u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9, local: \u771f\u507d\u5024) do |form| %&gt;\r\n\u8868\u793a\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u306e\u5185\u5bb9\r\n&lt;% end %&gt;<\/pre>\n<p>\u4eca\u56de\u306e\u5834\u5408\u306f\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306buser\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>user\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306e\u5024\u3092\u30d5\u30a9\u30fc\u30e0\u306e\u5185\u5bb9\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><\/span><\/p>\n<p><strong>local:\u771f\u507d\u5024<\/strong><\/p>\n<p><span style=\"color: #ff0000;\"><strong>Ajax\u306b\u3088\u308b\u30c7\u30fc\u30bf\u66f4\u65b0\u3092\u8a31\u53ef\u3059\u308b\u304b\u3069\u3046\u304b\u306e\u8a2d\u5b9a<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u771f\u507d\u5024<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>true<\/td>\n<td>Ajax\u306b\u3088\u308b\u30c7\u30fc\u30bf\u66f4\u65b0\u3092\u8a31\u53ef\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u5834\u5408\u306b\u6307\u5b9a\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>false<\/td>\n<td>Ajax\u306b\u3088\u308b\u30c7\u30fc\u30bf\u66f4\u65b0\u3092\u8a31\u53ef\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306b\u6307\u5b9a\u3059\u308b\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Ajax\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u5408\u308f\u305b\u3066\u3054\u89a7\u4e0b\u3055\u3044\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"w2Cww0FUwB\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=1860\">\u3010JavaScript\u3011Ajax\u306b\u3064\u3044\u3066<\/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=1860&#038;embed=true#?secret=w2Cww0FUwB\" data-secret=\"w2Cww0FUwB\" width=\"500\" height=\"282\" title=\"&#8220;\u3010JavaScript\u3011Ajax\u306b\u3064\u3044\u3066&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h4>\u753b\u9762\u306b\u51fa\u529b\u3055\u308c\u308bHTML<\/h4>\n<p>\u4e0b\u8a18\u306eHTML\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">&lt;form action=\"\/users\" accept-charset=\"UTF-8\" method=\"post\"&gt;\r\n&lt;input name=\"utf8\" type=\"hidden\" value=\"&amp;#x2713;\" \/&gt;\r\n&lt;input type=\"hidden\" name=\"authenticity_token\" value=\"Q7XS5s0p+B5fz9JkDZvOxWwzRtu5J5q3jBQXYaaQHOMLczS56uCvn1a97mU8gOv2l9PdP3jaK58ATFc+mvVVzg==\" \/&gt;\r\n\u2026\r\n&lt;\/form&gt;<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>\u300c&lt;input type=\"hidden\" name=\"authenticity_token\"\u2026\u300d\u304b\u3089\u59cb\u307e\u308binput\u30bf\u30b0<\/strong><\/span>\u306f\u3001<span style=\"color: #ff0000;\"><strong>CSRF(\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30ea\u30af\u30a8\u30b9\u30c8\u30d5\u30a9\u30fc\u30b8\u30a7\u30ea)\u3068\u3044\u3046\u4e0d\u6b63\u30a2\u30af\u30bb\u30b9\u5bfe\u7b56\u306b\u4f7f\u7528\u3055\u308c\u308b\u30bf\u30b0<\/strong><\/span>\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>label\u30d3\u30e5\u30fc\u30d8\u30eb\u30d1\u30fc\uff08&lt;%= form.label :name %&gt;\uff09<\/h3>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">&lt;%= form.label \u30d5\u30a3\u30fc\u30eb\u30c9\u540d %&gt;<\/pre>\n<p><strong>\u30d5\u30a3\u30fc\u30eb\u30c9\u540d<\/strong><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u540d<\/strong><\/span>\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h4>\u51fa\u529b\u3055\u308c\u308bHTML<\/h4>\n<pre class=\"lang:default decode:true\">&lt;label for=\"user_name\"&gt;Name&lt;\/label&gt;<\/pre>\n<p>for\u5c5e\u6027\u3067\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5024\u306f\u3001\u305d\u306e\u5f8c\u306b\u751f\u6210\u3055\u308c\u308b\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\u7b49\u306e\u5024\u3068\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>text_area\u30d3\u30e5\u30fc\u30d8\u30eb\u30d1\u30fc(&lt;%= form.text_area :name %&gt;)<\/h3>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">&lt;%= form.text_area \u5f15\u6570,\u5c5e\u6027\u540d1:\u50241 %&gt;<\/pre>\n<p>\u767b\u9332\u753b\u9762\u306b\u3001<span style=\"color: #ff0000;\"><strong>\u300ctextarea\u30bf\u30b0\u300d<\/strong><\/span>\u3092\u51fa\u529b\u3057\u307e\u3059\u3002\u4efb\u610f\u3067\u3059\u304c\u3001\u51fa\u529b\u3055\u308c\u308btextarea\u30bf\u30b0\u306b<span style=\"color: #ff0000;\"><strong>\u5c5e\u6027\u3092\u5897\u3084\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u6307\u5b9a<\/strong><\/span>\u3057\u307e\u3059\u3002<\/p>\n<h4>\u51fa\u529b\u3055\u308c\u308bHTML<\/h4>\n<pre class=\"lang:default decode:true\">&lt;textarea name=\"user[name]\" id=\"user_name\"&gt;\r\n&lt;\/textarea&gt;<\/pre>\n<p>name\u5c5e\u6027\u306b\u306f\u3001\u300c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u540d[\u30ab\u30e9\u30e0\u540d]\u300d\u306e\u3088\u3046\u306a\u914d\u5217\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>submit\u30d3\u30e5\u30fc\u30d8\u30eb\u30d1\u30fc(&lt;%= form.submit %&gt;)<\/h3>\n<h4>\u69cb\u6587<\/h4>\n<pre class=\"lang:default decode:true\">&lt;%= form.submit %&gt;<\/pre>\n<p>\u767b\u9332\u753b\u9762\u306b<span style=\"color: #ff0000;\"><strong>\u30b5\u30d6\u30df\u30c3\u30c8\u30dc\u30bf\u30f3<\/strong><\/span>\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<h4>\u51fa\u529b\u3055\u308c\u308bHTML<\/h4>\n<pre class=\"lang:default decode:true\">&lt;input type=\"submit\" name=\"commit\" value=\"Create User\" data-disable-with=\"Create User\" \/&gt;<\/pre>\n<p>data-disable-with\u5c5e\u6027\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u4e8c\u91cd\u30af\u30ea\u30c3\u30af\u9632\u6b62\u5bfe\u7b56<\/strong><\/span>\u306e\u305f\u3081\u306e\u5c5e\u6027\u3067\u3059\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u767b\u9332<\/h2>\n<p>Scaffolding\u3067\u751f\u6210\u3055\u308c\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u767b\u9332\u753b\u9762\u306e\u30d5\u30a9\u30fc\u30e0\u90e8\u5206\u3092\u898b\u308b\u3068<span style=\"color: #ff0000;\"><strong>URL\u304c\u300cfamilies(\u30ea\u30bd\u30fc\u30b9\u540d\uff09\u300d\u306b\u5bfe\u3057\u3066POST\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/strong><\/span><\/p>\n<pre class=\"lang:default decode:true\">&lt;form action=\"\/families\" accept-charset=\"UTF-8\" method=\"post\"&gt;\r\n\u3000&lt;input type=\"hidden\" name=\"authenticity_token\" value=\"rI2sNF03GVrmh1i+zm3ZQNrJ7uIRAGVKEZNDgepKM0djHXNCNhV2aZbKzDxhxo\/1H6zQXRD0oKLkqz3fPnvhaQ==\" \/&gt;\r\n\u3000\u2025\r\n  &lt;div class=\"actions\"&gt;\r\n    &lt;input type=\"submit\" name=\"commit\" value=\"Create Family\" data-disable-with=\"Create Family\" \/&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/form&gt;\r\n<\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u60c5\u5831\u3092\u307f\u3066\u307f\u308b\u3068families\u306ePOST\u306f<span style=\"color: #ff0000;\"><strong>create\u30e1\u30bd\u30c3\u30c9<\/strong><\/span>\u3092\u547c\u3076\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-7501\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2019\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-11-25-20.57.55.png\" alt=\"\" width=\"1888\" height=\"320\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2019\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-11-25-20.57.55.png 1888w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2019\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-11-25-20.57.55-300x51.png 300w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2019\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-11-25-20.57.55-768x130.png 768w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2019\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-11-25-20.57.55-1024x174.png 1024w\" sizes=\"(max-width: 1888px) 100vw, 1888px\" \/><\/p>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306ecreate\u30e1\u30bd\u30c3\u30c9\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">  def create\r\n    @family = Family.new(family_params)\r\n\r\n    respond_to do |format|\r\n      if @family.save\r\n        format.html { redirect_to @family, notice: 'Family was successfully created.' }\r\n        format.json { render :show, status: :created, location: @family }\r\n      else\r\n        format.html { render :new }\r\n        format.json { render json: @family.errors, status: :unprocessable_entity }\r\n      end\r\n    end\r\n  end<\/pre>\n<h3>@family = Family.new(family_params)<\/h3>\n<p>famiily_params\u30e1\u30bd\u30c3\u30c9\u306e\u623b\u308a\u5024\u3092\u5f15\u6570\u3068\u3057\u3066<span style=\"color: #ff0000;\"><strong>familiy\u30e2\u30c7\u30eb\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092new\u30e1\u30bd\u30c3\u30c9\u3067\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/strong><\/span><\/p>\n<h4>famiily_params\u30e1\u30bd\u30c3\u30c9<\/h4>\n<p>\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u540c\u3058\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">    def family_params\r\n      params.require(:family).permit(:name)\r\n    end<\/pre>\n<h5>Strong Parameters(\u30b9\u30c8\u30ed\u30f3\u30b0\u30d1\u30e9\u30e1\u30fc\u30bf\uff09<\/h5>\n<p>Strong Parameters(\u30b9\u30c8\u30ed\u30f3\u30b0\u30d1\u30e9\u30e1\u30fc\u30bf\uff09\u3068\u3044\u3046\u69cb\u6587\u3067\u4e0b\u8a18\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>Strong Parameters\u306f\u610f\u56f3\u3057\u306a\u3044\u30ad\u30fc\u304b\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5f3e\u304d\u30a8\u30e9\u30fc\u3068\u3059\u308b\u306e\u3067\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u306b\u3082\u306a\u308a\u307e\u3059\u3002<\/strong><\/span>Rails4\u304b\u3089\u8ffd\u52a0\u3055\u308c\u305f\u4ed5\u7d44\u307f\u3067\u3059\u3002(Rails3\u307e\u3067\u306f\u540c\u3058\u3088\u3046\u306a\u4ed5\u7d44\u307f\u3068\u3057\u3066MassAssignment\u304c\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u8106\u5f31\u6027\u304c\u898b\u3064\u304b\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308dStrong Parameter\u304c\u4e00\u822c\u7684\u306b\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\uff09\u753b\u9762\u304b\u3089\u30b5\u30fc\u30d0\u306b\u9001\u3089\u308c\u3066\u304f\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u5236\u9650\u3092\u304b\u3051\u308b\u3053\u3068\u304c\u3067\u304d<span style=\"color: #ff0000;\"><strong>\u4e0d\u7528\u610f\u306a\u30c7\u30fc\u30bf\u304cDB\u306b\u767b\u9332\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3068\u3044\u3046\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><\/span><\/p>\n<pre class=\"lang:default decode:true\">params.require(\u30e2\u30c7\u30eb\u540d\uff09.permit(\u30ad\u30fc1,\u30ad\u30fc2\u2025\uff09<\/pre>\n<h6>params<\/h6>\n<p><span style=\"color: #ff0000;\"><strong>\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u5024<\/strong><\/span>\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h6>require(:family)<\/h6>\n<p>\u5f15\u6570\u306b\u306f\u53d6\u5f97\u3057\u305f\u3044\u30e2\u30c7\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u305d\u3046\u3059\u308b\u3068<span style=\"color: #ff0000;\"><strong>\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306e\u5024\u306e\u30cf\u30c3\u30b7\u30e5\uff08\u30ad\u30fc\u3068\u5024\u306e\u7d44\u307f\u5408\u308f\u305b\uff09<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h6>permit<\/h6>\n<p>\u30cf\u30c3\u30b7\u30e5\u304b\u3089\u53d6\u5f97\u3057\u305f\u3044\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306e\u5024\u306e\u30ad\u30fc\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h3>respond_to\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u30d5\u30a1\u30a4\u30eb\u306eURL\u306e\u672b\u5c3e\u306e\u62e1\u5f35\u5b50\u306b\u3088\u3063\u3066\u51e6\u7406\u3092\u5206\u3051\u308b\u5834\u5408<\/strong><\/span>\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>Rails\u3067\u306fURL\u306b\u62e1\u5f35\u5b50\u304c\u4f55\u3082\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306fHTML\u3068\u5224\u65ad\u3057\u3001\u672b\u5c3e\u306b\u300c.json\u300d\u304c\u3064\u3044\u3066\u3044\u308b\u5834\u5408\u306f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304cJSON\u3068\u5224\u65ad\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">respond_to do |format|\r\n  format.html{URL\u306e\u62e1\u5f35\u5b50\u304cHTML\u306e\u5834\u5408\u306b\u5b9f\u65bd\u3059\u308b\u51e6\u7406}\r\n  format.json{URL\u306e\u62e1\u5f35\u5b50\u304cJSON\u306e\u5834\u5408\u306b\u5b9f\u65bd\u3059\u308b\u51e6\u7406}\r\nend<\/pre>\n<h3>@family.save<\/h3>\n<p>family\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u4fdd\u5b58\u306b\u6210\u529f\u3057\u305f\u3089true\u3092\u8fd4\u3057\u5931\u6557\u3057\u305f\u3089false\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<h3>redirect_to\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u884c\u3044\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u5f8c\u8ff0\u3059\u308brender\u3068\u9055\u3063\u3066URL\u3092\u76f4\u63a5\u5b9f\u884c\u3059\u308b\u306e\u3067\u518d\u5ea6\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u767a\u751f\u3059\u308b<\/strong><\/span>\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">redirect_to \u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u5148,\u51fa\u529b\u30e1\u30c3\u30bb\u30fc\u30b8(flash\u30e1\u30c3\u30bb\u30fc\u30b8\uff09<\/pre>\n<h4>redirect_to @family<\/h4>\n<p><span style=\"color: #ff0000;\"><strong>@family\u3068\u3044\u3046\u306e\u306f\u73fe\u5728\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306eID\u3092\u793a\u3059\u306e\u3067\u300cfamilies\/\u65b0\u898f\u767b\u9332ID\u300d\u3068\u3044\u3046URL\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u308b<\/strong><\/span>\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u60c5\u5831\u3092\u307f\u308b\u3068show\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u308b\u306e\u3067\u300cshow.html.erb\u300d\u3068\u3044\u3046\u30d3\u30e5\u30fc\u306b\u98db\u3076\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>flash\u30e1\u30c3\u30bb\u30fc\u30b8<\/h4>\n<p>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u969b\u306b\u3001<span style=\"color: #ff0000;\"><strong>\u6b21\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3057\u3066\u30c7\u30fc\u30bf\u3092\u4f1d\u3048\u308b\u305f\u3081\u306bRails\u304c\u7528\u610f\u3057\u3066\u3044\u308b\u4ed5\u7d44\u307f<\/strong><\/span>\u3067\u5185\u90e8\u7684\u306b\u306f\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3057\u3066\u5b9f\u73fe\u304c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306e\u3088\u3046\u306b\u300cnotice:\u300d\u3067\u6307\u5b9a\u3057\u305f\u5834\u5408\u306fnotice\u5909\u6570\u306b\u683c\u7d0d\u3055\u308c\u308b\u306e\u3067\u3001\u30d3\u30e5\u30fc\u5074\u306eHTML\u3067\u306f<span style=\"color: #ff0000;\"><strong>\u300c&lt;%= notice %&gt;\u300d<\/strong><\/span>\u3067\u53c2\u7167\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>render :show, status: :created, location: @family<\/h3>\n<p>\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u767b\u9332\u304c\u6210\u529f\u3057\u3066\u304b\u3064URL\u306e\u62e1\u5f35\u5b50\u304cJSON\u3060\u3063\u305f\u5834\u5408\u306e\u51e6\u7406\u3067\u3059\u3002<span style=\"color: #ff0000;\"><strong>redirect_to\u30e1\u30bd\u30c3\u30c9\u3068\u9055\u3063\u3066\uff12\u5ea6\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u767a\u751f\u306f\u3057\u307e\u305b\u3093\u3002<\/strong><\/span><\/p>\n<h4>render :show<\/h4>\n<p>views\/falimlies\/show.json.jbuilder\u3092\u30d3\u30e5\u30fc\u3068\u3057\u3066\u547c\u3076\u3002<\/p>\n<h4>status: :created<\/h4>\n<p>Web\u30b5\u30fc\u30d0\u304b\u3089\u306e\u5fdc\u7b54\u3092\u793a\u3057\u3001created\u306e\u5834\u5408\u306fHTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9201\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<h4>location: @family<\/h4>\n<p>\u65b0\u3057\u304f\u767b\u9332\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306eURL\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<h3>views\/falimlies\/show.json.jbuilder<\/h3>\n<p>\u767b\u9332\u304c\u6210\u529f\u3057\u3066\u3001URL\u306e\u62e1\u5f35\u5b50\u304cJSON\u3060\u3063\u305f\u5834\u5408\u306b\u547c\u3070\u308c\u308b\u30bd\u30fc\u30b9\u306b\u306a\u308a\u307e\u3059\u3002\u30bd\u30fc\u30b9\u306e\u4e2d\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u51e6\u7406\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">json.partial! \"families\/family\", family: @family<\/pre>\n<h4>json.partial!\u30d3\u30e5\u30fc\u30d8\u30eb\u30d1\u30fc<\/h4>\n<p>\u69cb\u6587\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u3066<span style=\"color: #ff0000;\"><strong>\u300cJBuilder\u5f62\u5f0f\u300d<\/strong><\/span>\u306e\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">json.partial! \u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u540d,\u30ad\u30fc1:\u50241,\u30ad\u30fc2:\u50242\u2025<\/pre>\n<p>\u5b9f\u969b\u306b\u547c\u3073\u51fa\u3059\u306e\u306f\u300cviews\/families\/_family.json.jbuilder\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>views\/families\/_family.json.jbuilder<\/h3>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">json.extract! family, :id, :name, :created_at, :updated_at\r\njson.url family_url(family, format: :json)<\/pre>\n<h4>json.extract!\u30d3\u30e5\u30fc\u30d8\u30eb\u30d1\u30fc<\/h4>\n<pre class=\"lang:default decode:true \">json.extract! \u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8,\u30ab\u30e9\u30e0\u8981\u7d201,\u30ab\u30e9\u30e0\u8981\u7d202\u2025<\/pre>\n<p>\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ad\u30fc\u3068\u5024\u306e\u30da\u30a2\u3092\u51fa\u529b\u3057\u307e\u3059\u3002\u4e0a\u8a18\u4f8b\u3067\u8a00\u3048\u3070\u3001family\u30c6\u30fc\u30d6\u30eb\u306eID\u3001\u540d\u524d\u3001\u767b\u9332\u65e5\u3001\u66f4\u65b0\u65e5\u3092JSON\u5f62\u5f0f\u3067\u51fa\u529b\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>json.url family_url(family, format: :json)<\/h4>\n<p>URL\u3092\u751f\u6210\u3057\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u300cfamilies\/ID.json\u300d<\/strong><\/span>\u3068\u3044\u3046URL\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3><span class=\"crayon-e\">render <\/span><span class=\"crayon-v\">json<\/span><span class=\"crayon-o\">:<\/span> <span class=\"crayon-sy\">@<\/span><span class=\"crayon-v\">family<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">errors<\/span><span class=\"crayon-sy\">,<\/span> <span class=\"crayon-v\">status<\/span><span class=\"crayon-o\">:<\/span> <span class=\"crayon-o\">:<\/span><span class=\"crayon-v\">unprocessable<\/span><span class=\"crayon-sy\">_<\/span>entity<\/h3>\n<h4><span class=\"crayon-v\">json<\/span><span class=\"crayon-o\">:<\/span> <span class=\"crayon-sy\">@<\/span><span class=\"crayon-v\">family<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">errors<\/span><\/h4>\n<p>\u5168\u3066\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092JSON\u5f62\u5f0f\u3067\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<h4><span class=\"crayon-v\">status<\/span><span class=\"crayon-o\">:<\/span> <span class=\"crayon-o\">:<\/span><span class=\"crayon-v\">unprocessable<\/span><span class=\"crayon-sy\">_<\/span>entity<\/h4>\n<p>HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9422\u3092\u8fd4\u3057\u51e6\u7406\u3067\u304d\u306a\u304b\u3063\u305f\u3053\u3068\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n<h2>jbuilder\u3068\u306f\uff1f<\/h2>\n<p>Rails\u304c\u6a19\u6e96\u3067\u63a1\u7528\u3057\u3066\u3044\u308bgem\u306e\u4e00\u3064\u3067JSON\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b\u305f\u3081\u306e\u7c21\u5358\u306a\u8a18\u8ff0\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u3066\u304f\u308c\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<h3>jbuilder\u306e\u62e1\u5f35\u5b50<\/h3>\n<p>\u62e1\u5f35\u5b50\u3092<span style=\"color: #ff0000;\"><strong>\u300c.json.jbuilder\u300d<\/strong><\/span>\u3068\u3059\u308b\u3068\u305d\u306e\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u5185\u3067jbuilder\u304c\u63d0\u4f9b\u3059\u308b\u8a18\u8ff0\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>jbuilder\u304c\u63d0\u4f9b\u3059\u308b\u8a18\u8ff0<\/h3>\n<h4>json.partial!\u30d3\u30e5\u30fc\u30d8\u30eb\u30d1\u30fc<\/h4>\n<p>jBuilder\u5f62\u5f0f\u306e\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>json.extract!\u30d3\u30e5\u30fc\u30d8\u30eb\u30d1\u30fc<\/h4>\n<p>\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ab\u30e9\u30e0\u8981\u7d20\u306e\u5024\u3092JSON\u5f62\u5f0f\u3067\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Ruby on Rails\u306e\u300cScaffolding(\u30b9\u30ad\u30e3\u30d5\u30a9\u30fc\u30eb\u30c7\u30a3\u30f3\u30b0)\u300d\u3068\u3044\u3046\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308c\u3070\u3001\u30a2\u30d7\u30ea\u306e\u96db\u5f62\u3092\u81ea\u52d5\u751f\u6210\u3067\u304d\u308b\u3068\u3054\u7d39\u4ecb\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002 \u3010Ruby on Rails\u3011\u306e\u300cO\/R\u30de\u30c3\u30d1\u30fc\u300d\u3067\u3042\u308b\u300cA [&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\/5081"}],"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=5081"}],"version-history":[{"count":15,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5081\/revisions"}],"predecessor-version":[{"id":20548,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5081\/revisions\/20548"}],"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=5081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5081"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}