2024.08.14(更新日: 2024.08.14)
posts/indexにアクセスした時の挙動

はじめに
http://localhost:3000/posts/index にアクセスすると、以下の表示になる。

ルーティング
config/routes.rb には、以下の記述がある。

これは、/posts/indexにアクセスした時に、postsコントローラのindexアクションが動作しますよという意味。
postsコントローラのindexアクション
以下のような記述である。

投稿ID : 23959
コメントを残す