{"id":2869,"date":"2021-11-14T21:43:03","date_gmt":"2021-11-14T12:43:03","guid":{"rendered":"https:\/\/suzutukiblog.com\/?p=2869"},"modified":"2022-01-22T02:57:32","modified_gmt":"2022-01-21T17:57:32","slug":"rails-tutorial-2","status":"publish","type":"post","link":"https:\/\/suzutukiblog.com\/index.php\/2021\/11\/14\/rails-tutorial-2\/","title":{"rendered":"Rails-tutorial\u81ea\u5206\u7528\u307e\u3068\u3081(2\u7ae0 \u4e3b\u306b\u6f14\u7fd2)"},"content":{"rendered":"<p><a href=\"https:\/\/suzutukiblog.com\/index.php\/2021\/04\/15\/rails-tutorial\/\">1\u304b\u3089\u7d9a\u304d\u307e\u3059<\/a><\/p>\n<h3>2\u7ae0\uff1aToy\u30a2\u30d7\u30ea\u3092\u4f5c\u308d\u3046\uff01<\/h3>\n<pre><strong>cd ~\/environment<\/strong>\r\n<strong>rails _5.1.6_ new toy_app<\/strong>\r\n<strong>cd toy_app\/<\/strong><\/pre>\n<h3>Gemfile\u3092\u7de8\u96c6\u3057\u3066\u3044\u304f<\/h3>\n<pre><strong>source 'https:\/\/rubygems.org'<\/strong>\r\n\r\n<strong>gem 'rails', '5.1.6'<\/strong>\r\n<strong>gem 'puma', '3.9.1'<\/strong>\r\n<strong>gem 'sass-rails', '5.0.6'<\/strong>\r\n<strong>gem 'uglifier', '3.2.0'<\/strong>\r\n<strong>gem 'coffee-rails', '4.2.2'<\/strong>\r\n<strong>gem 'jquery-rails', '4.3.1'<\/strong>\r\n<strong>gem 'turbolinks', '5.0.1'<\/strong>\r\n<strong>gem 'jbuilder', '2.7.0'<\/strong>\r\n\r\n<strong>group :development, :test do<\/strong>\r\n<strong>  gem 'sqlite3', '1.3.13'<\/strong>\r\n<strong>  gem 'byebug', '9.0.6', platform: :mri<\/strong>\r\n<strong>end<\/strong>\r\n\r\n<strong>group :development do<\/strong>\r\n<strong>  gem 'web-console', '3.5.1'<\/strong>\r\n<strong>  gem 'listen', '3.1.5'<\/strong>\r\n<strong>  gem 'spring', '2.0.2'<\/strong>\r\n<strong>  gem 'spring-watcher-listen', '2.0.1'<\/strong>\r\n<strong>end<\/strong>\r\n\r\n<strong>group :production do<\/strong>\r\n<strong>  gem 'pg', '0.20.0'<\/strong>\r\n<strong>end<\/strong><\/pre>\n<h3>Gem\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3059\u308b\u2193\u4ee5\u4e0b\u3092\u30b3\u30de\u30f3\u30c9<\/h3>\n<pre><strong>bundle update<\/strong>\r\n<strong>bundle install --without production<\/strong>\r\n<strong>git init<\/strong>\r\n<strong>git add -A<\/strong>\r\n<strong>git commit -m \"Initialize repository\"\r\ngit remote add origin git@bitbucket.org:&lt;username&gt;\/toy_app.git\r\ngit push -u origin --all<\/strong><\/pre>\n<h3>2.2 Users\u30ea\u30bd\u30fc\u30b9<\/h3>\n<p>Rails\u306escaffold\u306f\u3001<code>rails generate<\/code>\u30b9\u30af\u30ea\u30d7\u30c8\u306b<code>scaffold<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u6e21\u3059\u3053\u3068\u3067\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre><strong>rails generate scaffold User name:string email:string\r\nrails db:migrate\r\n<\/strong><\/pre>\n<h3>2.2.2 MVC\u306e\u6319\u52d5<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2873\" src=\"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2021\/04\/d395bc9e958dae18c8d0143ae538b29e.png\" alt=\"\" width=\"573\" height=\"575\" srcset=\"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2021\/04\/d395bc9e958dae18c8d0143ae538b29e.png 573w, https:\/\/suzutukiblog.com\/wp-content\/uploads\/2021\/04\/d395bc9e958dae18c8d0143ae538b29e-300x300.png 300w, https:\/\/suzutukiblog.com\/wp-content\/uploads\/2021\/04\/d395bc9e958dae18c8d0143ae538b29e-150x150.png 150w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/p>\n<p><!--more--><\/p>\n<pre><strong>1:\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u300c\/users\u300d\u3068\u3044\u3046URL\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092Rails\u30b5\u30fc\u30d0\u30fc\u306b\u9001\u4fe1\u3059\u308b\u3002<\/strong>\r\n\r\n<strong>2:\/users\u300d\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u3001Rails\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u6a5f\u69cb (\u30eb\u30fc\u30bf\u30fc) \u306b\u3088\u3063\u3066Users\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u5185\u306eindex\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u308b\u3002<\/strong>\r\n\r\n<strong>3:index\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u3001\u305d\u3053\u304b\u3089User\u30e2\u30c7\u30eb\u306b\u3001\u300c\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u53d6\u308a\u51fa\u305b\u300d(User.all)\u3068\u554f\u3044\u5408\u308f\u305b\u308b\u3002<\/strong>\r\n\r\n<strong>4:User\u30e2\u30c7\u30eb\u306f\u554f\u3044\u5408\u308f\u305b\u3092\u53d7\u3051\u3001\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u308a\u51fa\u3059\u3002<\/strong>\r\n\r\n<strong>5:\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u308a\u51fa\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u306e\u4e00\u89a7\u3092User\u30e2\u30c7\u30eb\u304b\u3089\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306b\u8fd4\u3059\u3002<\/strong>\r\n\r\n<strong>6:Users\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u4e00\u89a7\u3092@users\u5909\u6570 (@\u306fRuby\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3092\u8868\u3059) \u306b\u4fdd\u5b58\u3057\u3001index\u30d3\u30e5\u30fc\u306b\u6e21\u3059\u3002<\/strong>\r\n\r\n<strong>7:index\u30d3\u30e5\u30fc\u304c\u8d77\u52d5\u3057\u3001ERB (Embedded RuBy: \u30d3\u30e5\u30fc\u306eHTML\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3066\u3044\u308bRuby\u30b3\u30fc\u30c9) \u3092\u5b9f\u884c\u3057\u3066 HTML\u3092\u751f\u6210 (\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0) \u3059\u308b\u3002<\/strong>\r\n\r\n<strong>8:\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306f\u3001\u30d3\u30e5\u30fc\u3067\u751f\u6210\u3055\u308c\u305fHTML\u3092\u53d7\u3051\u53d6\u308a\u3001\u30d6\u30e9\u30a6\u30b6\u306b\u8fd4\u3059\u3002<\/strong>\r\n\r\n<strong>Rails\u30eb\u30fc\u30c8\u3067\u4f7f\u3046Users\u30ea\u30bd\u30fc\u30b9\u7528\u306e\u30eb\u30fc\u30eb<\/strong><\/pre>\n<pre><strong>config\/routes.rb\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u3092\u3059\u308b\r\n<\/strong>\r\n<strong>Rails.application.routes.draw do<\/strong>\r\n<strong> resources :users<\/strong>\r\n<strong> root 'application#hello'<\/strong>\r\n<strong>end<\/strong><\/pre>\n<pre>\u30eb\u30fc\u30c8\u304b\u3089users\u3078\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u8ffd\u52a0\u3059\u308b \r\n<strong>config\/routes.rb\r\n<\/strong>\r\n<strong>Rails.application.routes.draw do\r\n resources :users\r\n root 'users#index'\r\nend<\/strong><\/pre>\n<p>GET \/users index\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u4e00\u89a7\u3059\u308b\u30da\u30fc\u30b8<br \/>\nGET \/users\/1 show\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 id=1\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u8868\u793a\u3059\u308b\u30da\u30fc\u30b8<br \/>\nGET \/users\/new new\u00a0 \u00a0 \u00a0 \u00a0 \u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b\u30da\u30fc\u30b8<br \/>\nPOST \/users create\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3<br \/>\nGET \/users\/1\/edit edit\u00a0 \u00a0 \u00a0 \u00a0id=1\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u7de8\u96c6\u3059\u308b\u30da\u30fc\u30b8<br \/>\nPATCH \/users\/1 update\u00a0 \u00a0 id=1\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u66f4\u65b0\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3<br \/>\nDELETE \/users\/1 destroy\u00a0 id=1\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3<\/p>\n<p>Toy\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u7c21\u6f54\u306a\u30e6\u30fc\u30b6\u30fcindex\u30a2\u30af\u30b7\u30e7\u30f3<br \/>\n<strong>app\/controllers\/users_controller.rb<\/strong><\/p>\n<pre><strong> app\/controllers\/users_controller.rb<\/strong>\r\n<strong>class UsersController &lt; ApplicationController\r\n.\r\n.\r\n.\r\n  def index\r\n   @users = User.all\r\n  end\r\n.\r\n.\r\nend<\/strong><\/pre>\n<p>index\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30d3\u30e5\u30fc<\/p>\n<pre><strong>app\/views\/users\/index.html.erb<\/strong>\r\n\r\n<strong>&lt;h1&gt;Listing users&lt;\/h1&gt;<\/strong>\r\n<strong> &lt;table&gt;<\/strong>\r\n<strong>  &lt;thead&gt;<\/strong>\r\n<strong>   &lt;tr&gt;<\/strong>\r\n<strong>    &lt;th&gt;Name&lt;\/th&gt;<\/strong>\r\n<strong>    &lt;th&gt;Email&lt;\/th&gt;<\/strong>\r\n<strong>    &lt;th colspan=\"3\"&gt;&lt;\/th&gt;<\/strong>\r\n<strong>   &lt;\/tr&gt;<\/strong>\r\n<strong>  &lt;\/thead&gt;<\/strong>\r\n<strong>   &lt;% @users.each do |user| %&gt;<\/strong>\r\n<strong>    &lt;tr&gt;<\/strong>\r\n<strong>     &lt;td&gt;&lt;%= user.name %&gt;&lt;\/td&gt;<\/strong>\r\n<strong>     &lt;td&gt;&lt;%= user.email %&gt;&lt;\/td&gt;<\/strong>\r\n<strong>     &lt;td&gt;&lt;%= link_to 'Show', user %&gt;&lt;\/td&gt;<\/strong>\r\n<strong>     &lt;td&gt;&lt;%= link_to 'Edit', edit_user_path(user) %&gt;&lt;\/td&gt;<\/strong>\r\n<strong>     &lt;td&gt;&lt;%= link_to 'Destroy', user, method: :delete,<\/strong>\r\n<strong>              data: { confirm: 'Are you sure?' } %&gt;&lt;\/td&gt;<\/strong>\r\n<strong>     &lt;\/tr&gt;<\/strong>\r\n<strong>   &lt;% end %&gt;<\/strong>\r\n<strong>  &lt;\/table&gt;<\/strong><strong>&lt;br&gt;<\/strong>\r\n<strong>&lt;%= link_to 'New User', new_user_path %&gt;<\/strong><\/pre>\n<h3>\u6f14\u7fd2<\/h3>\n<h3>1:2.2.2\u3092\u53c2\u8003\u306b\u3057\/users\/1\/edit\u3068\u3044\u3046URL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d\u306e<br \/>\n\u632f\u308b\u821e\u3044\u306b\u3064\u3044\u3066\u56f3\u3092\u66f8\u3044\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/h3>\n<p>2.2.2\u306e\u56f3\u3067\u8133\u5185\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u3002<\/p>\n<p><strong>1:\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u300c\/users1\/edit\u300d\u3068\u3044\u3046URL\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092Rails\u30b5\u30fc\u30d0\u30fc\u306b\u9001\u4fe1\u3059\u308b\u3002<\/strong><\/p>\n<p><strong> 2:\/users1\/edit\u300d\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u3001Rails\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u6a5f\u69cb (\u30eb\u30fc\u30bf\u30fc) \u306b\u3088\u3063\u3066Users\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u5185\u306eedit\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u308b\u3002<\/strong><\/p>\n<p><strong> 3:index\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u3001\u305d\u3053\u304b\u3089User\u30e2\u30c7\u30eb\u306b\u3001\u9078\u629e\u3057\u305f\u3082\u306e\u3092\u53d6\u308a\u51fa\u305b@user = User.find(params[:id])\u3068\u554f\u3044\u5408\u308f\u305b\u308b\u3002 <\/strong><\/p>\n<p><strong>4:User\u30e2\u30c7\u30eb\u306f\u554f\u3044\u5408\u308f\u305b\u3092\u53d7\u3051\u3001\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u308a\u51fa\u3059\u3002 <\/strong><\/p>\n<p><strong>5:\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u308a\u51fa\u3057\u305f\u7de8\u96c6\u3057\u305f\u3044\u3082\u306e\u3092User\u30e2\u30c7\u30eb\u304b\u3089\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306b\u8fd4\u3059\u3002 <\/strong><\/p>\n<p><strong>6:Users\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306f\u3001\u7de8\u96c6\u3057\u305f\u3044\u3082\u306e\u3092@user\u5909\u6570 (@\u306fRuby\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3092\u8868\u3059) \u306b\u4fdd\u5b58\u3057\u3001edit\u30d3\u30e5\u30fc\u306b\u6e21\u3059\u3002 <\/strong><\/p>\n<p><strong>7:edit\u30d3\u30e5\u30fc\u304c\u8d77\u52d5\u3057\u3001ERB (Embedded RuBy: \u30d3\u30e5\u30fc\u306eHTML\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3066\u3044\u308bRuby\u30b3\u30fc\u30c9) \u3092\u5b9f\u884c\u3057\u3066HTML\u3092\u751f\u6210 (\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0) \u3059\u308b\u3002 <\/strong><\/p>\n<p><strong>8:\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306f\u3001\u30d3\u30e5\u30fc\u3067\u751f\u6210\u3055\u308c\u305fHTML\u3092\u53d7\u3051\u53d6\u308a\u3001\u30d6\u30e9\u30a6\u30b6\u306b\u8fd4\u3059\u3002 Rails\u30eb\u30fc\u30c8\u3067\u4f7f\u3046Users\u30ea\u30bd\u30fc\u30b9\u7528\u306e\u30eb\u30fc\u30eb<\/strong><\/p>\n<h3>2:\u56f3\u793a\u3057\u305f\u632f\u308b\u821e\u3044\u3092\u898b\u306a\u304c\u3089\u3001Scaffold\u3067\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u306e\u4e2d\u3067<br \/>\n\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u30b3\u30fc\u30c9\u3092\u63a2\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/h3>\n<pre><strong>users_controller.rb\u306e<\/strong>\r\n\r\n<strong>class UsersController &lt; ApplicationController\r\n\uff08\u4e2d\u7565\uff09\r\nprivate\r\n\r\n  def set_user\r\n    @user = User.find(params[:id])\r\n  end\r\nend<\/strong><\/pre>\n<h3>3:\u30e6\u30fc\u30b6\u30fc\u306e\u60c5\u5831\u3092\u7de8\u96c6\u3059\u308b\u30da\u30fc\u30b8\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u4f55\u3067\u3057\u3087\u3046\u304b?<\/h3>\n<p><strong>edit.html.erb<\/strong><\/p>\n<h3>2.3.1\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8(\u30c4\u30a4\u30fc\u30c8)DB\u4f5c\u6210\u3068migrate<\/h3>\n<pre><strong>rails generate scaffold Micropost content:text user_id:integer<\/strong>\r\n\r\n<strong>rails db:migrate<\/strong>\r\n<\/pre>\n<pre><strong>config\/routes.rb<\/strong>\r\n<strong>  Rails.application.routes.draw do<\/strong>\r\n<strong>    resources :microposts<\/strong>\r\n<strong>    resources :users<\/strong>\r\n<strong>  root 'users#index'<\/strong>\r\n<strong>end<\/strong><\/pre>\n<pre><strong>#1\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u8907\u6570\u306e\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u304c\u3042\u308b\u3002<\/strong>\r\n<strong>app\/models\/user.rb<\/strong>\r\n\r\n<strong>class User &lt; ApplicationRecord<\/strong>\r\n<strong>  has_many :microposts<\/strong>\r\n<strong>end<\/strong><\/pre>\n<h3>\u6f14\u7fd22.3.1.1<\/h3>\n<p>CSS\u3092\u77e5\u3063\u3066\u3044\u308b\u8aad\u8005\u3078: \u65b0\u3057\u3044\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u3001\u30d6\u30e9\u30a6\u30b6\u306eHTML\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u30fc\u6a5f\u80fd\u3092\u4f7f\u3063\u3066\u300cMicropost was successfully created.\u300d\u306e\u7b87\u6240\u3092\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u30d6\u30e9\u30a6\u30b6\u3092\u30ea\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001\u305d\u306e\u7b87\u6240\u306f\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b?<\/p>\n<p>\u8868\u793a\u304c\u6d88\u3048\u308b<\/p>\n<h3>\u6f14\u7fd22.3.1.2<\/h3>\n<p>\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u306e\u4f5c\u6210\u753b\u9762\u3067\u3001Content\u3082User\u3082\u7a7a\u306b\u3057\u3066\u4f5c\u6210\u3057\u3088\u3046\u3068\u3059\u308b\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b?<\/p>\n<p>\u30a8\u30e9\u30fc\u306a\u304f\u3001\u767b\u9332\u6210\u529f\u3057\u3066\u3057\u307e\u3046<\/p>\n<p>&#8220;User was successfully created.&#8221;<\/p>\n<h3>\u6f14\u7fd22.3.1.3<\/h3>\n<p>141\u6587\u5b57\u4ee5\u4e0a\u306e\u6587\u5b57\u5217\u3092Content\u306b\u5165\u529b\u3057\u305f\u72b6\u614b\u3067\u3001\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b? (\u30d2\u30f3\u30c8: Wikipedia\u306eRuby\u306e\u8a18\u4e8b\u306b\u3042\u308b\uff11\u6bb5\u843d\u76ee\u304c\u3061\u3087\u3046\u3069150\u6587\u5b57\u7a0b\u5ea6\u3067\u3059\u304c\u3001\u3069\u3046\u306a\u308a\u307e\u3059\u304b?)<\/p>\n<p>\u30a8\u30e9\u30fc\u306a\u304f\u3001\u767b\u9332\u6210\u529f\u3057\u3066\u3057\u307e\u3046<br \/>\n&#8220;User was successfully created.&#8221;<\/p>\n<h3>\u6f14\u7fd22.3.1.4<\/h3>\n<p>\u4e0a\u8a18\u306e\u6f14\u7fd2\u3067\u4f5c\u6210\u3057\u305f\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u524a\u9664\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&#8220;Micropost was successfully destroyed.&#8221;<\/p>\n<h3><span class=\"number\">2.3.2\u00a0<\/span>\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u30de\u30a4\u30af\u30ed\u306b\u3059\u308b<\/h3>\n<p>\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u306e\u6700\u5927\u6587\u5b57\u6570\u3092140\u6587\u5b57\u306b\u5236\u9650\u3059\u308b\u3002<\/p>\n<pre><strong>app\/models\/micropost.rb<\/strong>\r\n<strong>  class Micropost &lt; ApplicationRecord<\/strong>\r\n<strong>    validates :content, length: { maximum: 140 }<\/strong>\r\n<strong>  end<\/strong><\/pre>\n<h3>\u6f14\u7fd22.3.2.1<\/h3>\n<p>\u5148\u307b\u30692.3.1.1\u306e\u6f14\u7fd2\u3067\u3084\u3063\u305f\u3088\u3046\u306b\u3001\u3082\u3046\u4e00\u5ea6Content\u306b141\u6587\u5b57\u4ee5\u4e0a\u3092\u5165\u529b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3069\u306e\u3088\u3046\u306b\u632f\u308b\u821e\u3044\u304c\u5909\u308f\u3063\u305f\u3067\u3057\u3087\u3046\u304b?<\/p>\n<p>\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b<\/p>\n<h3>\u6f14\u7fd22.3.2.2<\/h3>\n<p>\u30d6\u30e9\u30a6\u30b6\u306eHTML\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u30fc\u6a5f\u80fd\u3092\u4f7f\u3063\u3066\u3001\u8868\u793a\u3055\u308c\u305f\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n&#8216;error_explanation&#8217;\u3068\u3044\u3046id\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b<\/p>\n<h3><span class=\"number\">2.3.3\u00a0<\/span>\u30e6\u30fc\u30b6\u30fc\u306f\u305f\u304f\u3055\u3093\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u6301\u3063\u3066\u3044\u308b<\/h3>\n<pre>1\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u8907\u6570\u306e\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u304c\u3042\u308b\u3002\r\n<strong>app\/models\/user.rb<\/strong>\r\n<strong>\r\nclass User &lt; ApplicationRecord<\/strong>\r\n<strong> has_many :microposts<\/strong>\r\n<strong>end<\/strong>\r\n<\/pre>\n<pre>1\u3064\u306e\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u306f1\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u306e\u307f\u5c5e\u3059\u308b\u3002 \r\n<strong>app\/models\/micropost.rb<\/strong>\r\n<strong>\r\nclass Micropost &lt; ApplicationRecord<\/strong>\r\n<strong>  belongs_to :user<\/strong>\r\n<strong>  validates :content, length: { maximum: 140 }<\/strong>\r\n<strong>end<\/strong><\/pre>\n<h3>\u6f14\u7fd22.3.3.1<\/h3>\n<p>\u30e6\u30fc\u30b6\u30fc\u306eshow\u30da\u30fc\u30b8\u3092\u7de8\u96c6\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u6700\u521d\u306e\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u540c\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u4ed6\u306e\u30b3\u30fc\u30c9\u304b\u3089\u6587\u6cd5\u3092\u63a8\u6e2c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u3046\u307e\u304f\u8868\u793a\u3067\u304d\u305f\u304b\u3069\u3046\u304b\u3001\/users\/1 \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>&#8220;&lt;%= @user.microposts.first.content %&gt;&#8221;<\/strong>\u3092\u8ffd\u52a0<\/p>\n<p><strong>users_show.html.erb<\/strong><\/p>\n<pre><strong>\uff08\u524d\u7565\uff09<\/strong>\r\n<strong>&lt;p&gt;<\/strong>\r\n<strong>&lt;strong&gt;Content:&lt;\/strong&gt;<\/strong>\r\n<strong>&lt;%= @user.microposts.first.content %&gt;<\/strong>\r\n<strong>&lt;\/p&gt;<\/strong>\r\n<strong>\uff08\u5f8c\u7565\uff09<\/strong><\/pre>\n<h3>first\u30e1\u30bd\u30c3\u30c9\u306b\u3088\u3063\u3066\u6700\u521d\u306e\u914d\u5217\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u3002last\u306f\u6700\u5f8c\u304b\u3089\u53d6\u308c\u308b\u3088\uff01<\/h3>\n<h3>\u6f14\u7fd22.3.3.2<\/h3>\n<p>\u30ea\u30b9\u30c8 2.16\u306f\u3001\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u306eContent\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u691c\u8a3c\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u304c\u7a7a\u3067\u306a\u3044\u3053\u3068\u3092\u691c\u8a3c\u3067\u304d\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3001\u5b9f\u969b\u306b\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046 (\u56f3 2.16\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u6210\u529f\u3067\u3059)\u3002<\/p>\n<p>\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306e\u78ba\u8a8d<\/p>\n<pre><strong>app\/models\/micropost.rb<\/strong>\r\n<strong>class Micropost &lt; ApplicationRecord<\/strong>\r\n<strong>  belongs_to :user<\/strong>\r\n<strong>  validates :content, length: { maximum: 140 },<\/strong>\r\n<strong>  presence: true<\/strong>\r\n<strong>end<\/strong><\/pre>\n<p>\u7b54\u3048\uff1a\u5b9f\u969b\u306b\u8a66\u3057\u3066\u691c\u8a3c\u3059\u308b(\u30d5\u30a9\u30fc\u30e0\u306b\u4f55\u3082\u66f8\u304b\u306a\u3044\u3067\u6295\u7a3f\u3059\u308b)<\/p>\n<h3>\u6f14\u7fd22.3.3.3<\/h3>\n<p>\u30ea\u30b9\u30c8 2.17\u306eFILL_IN\u3068\u306a\u3063\u3066\u3044\u308b\u7b87\u6240\u3092\u66f8\u304d\u63db\u3048\u3066\u3001User\u30e2\u30c7\u30eb\u306ename\u3068email\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u691c\u8a3c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044<\/p>\n<p><strong>app\/models\/user.rb<\/strong><\/p>\n<pre><strong>class User &lt; ApplicationRecord<\/strong>\r\n<strong>  has_many :microposts<\/strong>\r\n<strong>  validates :name, presence: true<\/strong>\r\n<strong>  validates :email, presence: true<\/strong>\r\n<strong>end<\/strong><\/pre>\n<p>\u7b54\u3048\uff1a\u5b9f\u969b\u306b\u8a66\u3057\u3066\u691c\u8a3c\u3059\u308b<\/p>\n<h3>\u6f14\u7fd22.3.4.1<\/h3>\n<p>Application\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001ApplicationController\u304cActionController::Base\u3092\u7d99\u627f\u3057\u3066\u3044\u308b\u90e8\u5206\u306e\u30b3\u30fc\u30c9\u3092\u63a2\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u7b54\u3048\uff1a<strong>class ApplicationController &lt; ActionController::Base<\/strong><\/p>\n<pre><strong>application_controller.rb<\/strong>\r\n\r\n<strong>class ApplicationController &lt; ActionController::Base<\/strong>\r\n(\u5f8c\u7565)<\/pre>\n<h3>\u6f14\u7fd22.3.4.2<\/h3>\n<p>\uff1c\u554f\u984c\uff1e ApplicationRecord\u304cActiveRecord::Base\u3092\u7d99\u627f\u3057\u3066\u3044\u308b\u30b3\u30fc\u30c9\u306f\u3069\u3053\u306b\u3042\u308b\u3067\u3057\u3087\u3046\u304b? \u5148\u307b\u3069\u306e\u6f14\u7fd2\u3092\u53c2\u8003\u306b\u3001\u63a2\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u30d2\u30f3\u30c8: \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3068\u672c\u8cea\u7684\u306b\u306f\u540c\u3058\u4ed5\u7d44\u307f\u306a\u306e\u3067\u3001app\/models\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u8abf\u3079\u3066\u307f\u308b\u3068?)<\/p>\n<p><strong>\u7b54\u3048\uff1aapp\/models\/application_record.rb\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u304c\u3042\u308b\u306e\u3092\u898b\u3064\u3051\u308b<\/strong><\/p>\n<p><strong>class ApplicationRecord &lt; ActiveRecord::Base<\/strong><br \/>\n(\u5f8c\u7565)<\/p>\n<h2>\u6f14\u7fd22.3.5.<\/h2>\n<h3>1:\u672c\u756a\u74b0\u5883\u3067\uff12\u301c\uff13\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/h3>\n<p>\u672c\u756a\u74b0\u5883\u306e\u30d5\u30a9\u30fc\u30e0\u3067\u5b9f\u969b\u306b\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<h3>2:\u672c\u756a\u74b0\u5883\u3067\u6700\u521d\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046<\/h3>\n<p>\u672c\u756a\u74b0\u5883\u3067\u6700\u521d\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u4f5c\u308b<\/p>\n<h3>3:\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u306eContent\u306b141\u6587\u5b57\u4ee5\u4e0a\u3092\u5165\u529b\u3057\u305f\u72b6\u614b\u3067\u3001\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u672c\u756a\u74b0\u5883\u3067\u3082\u3046\u307e\u304f\u52d5\u304f\u304b\u3069\u3046\u304b\u3001\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/h3>\n<p>\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u306eContent\u306b141\u6587\u5b57\u4ee5\u4e0a\u3092\u5165\u529b\u3057\u305f\u72b6\u614b\u3067\u3001\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u307e\u3068\u3081\uff1aScaffold\u306e\u826f\u3044\u70b9\u306f\uff1f<\/h3>\n<p>Rails\u5168\u4f53\u3092\u6982\u89b3\u3067\u304d\u305f\u3002<br \/>\nMVC\u30e2\u30c7\u30eb\u306b\u3064\u3044\u3066\u306e\u4ed5\u7d44\u307f\u304c\u308f\u304b\u3063\u305f\u3002<br \/>\nREST\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306b\u521d\u3081\u3066\u89e6\u308c\u305f\u3002<br \/>\n\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\u306e\u4f5c\u6210\u3092\u521d\u3081\u3066\u884c\u3063\u305f\u3002<br \/>\n\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u80cc\u5f8c\u306b\u6301\u3064Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u672c\u756a\u74b0\u5883\u3067\u52d5\u304b\u3057\u305f\u3002<\/p>\n<h3>Scaffod\u306e\u5f31\u70b9\u306f\uff1f<\/h3>\n<p>\u30ec\u30a4\u30a2\u30a6\u30c8\u3082\u30b9\u30bf\u30a4\u30eb\u3082\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u3002<br \/>\n\u201cHome\u201d \u3084 \u201cAbout\u201d \u306e\u3088\u3046\u306a\u5b9a\u756a\u306e\u9759\u7684\u306a\u30da\u30fc\u30b8\u304c\u306a\u3044\u3002<br \/>\n\u30e6\u30fc\u30b6\u30fc\u304c\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3067\u304d\u306a\u3044\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u753b\u50cf\u3092\u7f6e\u3051\u306a\u3044\u3002<br \/>\n\u30ed\u30b0\u30a4\u30f3\u306e\u4ed5\u7d44\u307f\u304c\u306a\u3044\u3002<br \/>\n\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u305f\u3081\u306e\u4ed5\u7d44\u307f\u304c\u307e\u3063\u305f\u304f\u306a\u3044\u3002<br \/>\n\u30e6\u30fc\u30b6\u30fc\u3068\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u306e\u81ea\u52d5\u95a2\u9023\u4ed8\u3051\u304c\u884c\u308f\u308c\u3066\u3044\u306a\u3044\u3002<br \/>\nTwitter\u306e\u3088\u3046\u306a\u300c\u30d5\u30a9\u30ed\u30ef\u30fc (following)\u6a5f\u80fd\u300d\u3084<br \/>\n\u300c\u30d5\u30a9\u30ed\u30fc\u4e2d (followed)\u6a5f\u80fd\u300d\u304c\u306a\u3044\u3002<br \/>\n\u30de\u30a4\u30af\u30ed\u30dd\u30b9\u30c8\u3092\u30d5\u30a3\u30fc\u30c9\u3067\u304d\u306a\u3044\u3002<br \/>\n\u307e\u3068\u3082\u306a\u30c6\u30b9\u30c8\u304c\u306a\u3044\u3000\u7406\u89e3\u304c\u56f0\u96e3\u3002<\/p>\n<h3><span class=\"number\">2<\/span>\u7ae0\u306e\u307e\u3068\u3081<\/h3>\n<ol>\n<li>\n<h4>Scaffold\u6a5f\u80fd\u3067\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b\u3068\u3001Web\u306e\u3042\u3089\u3086\u308b\u90e8\u5206\u304b\u3089\u30e2\u30c7\u30eb\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3084\u308a\u3068\u308a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b<\/h4>\n<\/li>\n<li>\n<h4>Scaffold\u306f\u4f55\u3088\u308a\u3082\u624b\u3063\u53d6\u308a\u65e9\u3044\u306e\u304c\u3068\u308a\u3048\u3060\u304c\u3001\u3053\u308c\u3092\u5143\u306bRails\u3092\u7406\u89e3\u3059\u308b\u306b\u306f\u5411\u3044\u3066\u3044\u306a\u3044<\/h4>\n<\/li>\n<li>\n<h4>Rails\u3067\u306fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u69cb\u6210\u306bMVC (Model-View-Controller) \u3068\u3044\u3046\u30e2\u30c7\u30eb\u3092\u63a1\u7528\u3057\u3066\u3044\u308b<\/h4>\n<\/li>\n<li>\n<h4>Rails\u304c\u89e3\u91c8\u3059\u308bREST\u306b\u306f\u3001\u6a19\u6e96\u7684\u306aURL\u30bb\u30c3\u30c8\u3068\u3001\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\u3068\u3084\u308a\u3068\u308a\u3059\u308b\u305f\u3081\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u542b\u307e\u308c\u3066\u3044\u308b<\/h4>\n<\/li>\n<li>\n<h4>Rails\u3067\u306f\u30c7\u30fc\u30bf\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3 (validation) \u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\u306e\u5c5e\u6027\u306e\u5024\u306b\u5236\u9650\u3092\u304b\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/h4>\n<\/li>\n<li>\n<h4>Rails\u306b\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\u540c\u58eb\u3092\u95a2\u9023\u4ed8\u3051\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306e\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u304c\u591a\u6570\u7528\u610f\u3055\u308c\u3066\u3044\u308b<\/h4>\n<\/li>\n<li>\n<h4>Rails\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u4f7f\u3046\u3068\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089Rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u3084\u308a\u3068\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/h4>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/suzutukiblog.com\/index.php\/2021\/04\/16\/rails-tutorial-3\/\">\u305d\u306e\uff13\u306b\u7d9a\u304f<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u304b\u3089\u7d9a\u304d\u307e\u3059 2\u7ae0\uff1aToy\u30a2\u30d7\u30ea\u3092\u4f5c\u308d\u3046\uff01 cd ~\/environment rails _5.1.6_ new toy_app cd toy_app\/ Gemfile\u3092\u7de8\u96c6\u3057\u3066\u3044\u304f source &#8216;https:\/\/r [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2764,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[27,13],"tags":[],"class_list":["post-2869","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-note","category-rails"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=2869"}],"version-history":[{"count":15,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2869\/revisions"}],"predecessor-version":[{"id":4519,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2869\/revisions\/4519"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/media\/2764"}],"wp:attachment":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=2869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=2869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=2869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}