Help us understand the problem. What is going on with this article?

【Rails】routesの確認

ルート記載ファイル

routes.rb
config/routes.rb

確認方法

コマンドで叩く

bin/rails routes
rails routes

rakeとrailsの違いってなんだ!?(唐突)

でルートの表示

表示内容

Prefix Verb URI Pattern Controller#Action
  • Prefix: 名前付きヘルパー
  • Verb: HTTP動詞
  • UPI(Uniform Resource Identifier): 識別ルール(URLより大きい概念)
  • Controller#Action: そのまま

※ Prefixを利用すると、

link_to

などで簡単に記載できるらしい。(やったことない)
参考

(.:format)とは

ファイル形式を自由に識別できるっぽい
参考

おしまい

検索

https://railsguides.jp/routing.html

 bin/rails routes -g terms_of_service_caregiver_sign_up_index_path

pryでもroutesを確認できるようなので、またやってみたいです。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away