0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Rails】Routingのカンペ(scope / namespace / module / action / as / コロン / constraintsの意味)

Last updated at Posted at 2022-01-14

はじめに

routesの読み方で不安になった時用のカンペです。
scope / namespace / moduleの根本の動作が知りたい方はこちらが参考になります。
https://qiita.com/ryosuketter/items/9240d8c2561b5989f049

目次

  1. まとめ
    1. scope
    2. module
    3. namespace
    4. as
    5. コロン
    6. constraints

まとめ

scope

scopeに指定した文字がurlにのみ影響する

module

moduleに指定した文字がファイル構成にのみ影響する

namespace

namespaceに指定した文字がurl、ファイル構成、Prefixの全てに影響する

as

Prefixをオーバーライドする

コロン

動的に変化する部分

constraints

コロン部分の制約を設定

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?