LoginSignup
0
0

More than 1 year has passed since last update.

【Rails】rails routesの見方

Posted at

rails routesの見方

現在のルーティングを確認する際にroutes.rbフォルダを見に行く方法もありますが、以下のコマンドでも確認できます。

$ rails routes

上記コードを入力すると下のような画面がターミナル上で表示されます。

スクリーンショット 2022-01-15 11.53.56.jpg

Prefix:URLのニックネームです。(routes.rb内で「as:ニックネーム」で設定したものがここに表示されます)

Verb:HTTPメソッドです。

URI:URL(例 /books)
※(.:format)というのは、/books.htmlとしてもいいよという意味です。htmlがフォーマットです。

Controller#Action:コントローラーとアクションを意味しています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0