0
0

xxx_pathの"xxx"をどう設定するか調べるには

Posted at

ターミナル上でdocker-compose run web bin/rails routesコマンドを実行する
(config/routes.rbに定義されたルーティングとそれぞれの Prefix, Verb, URI Pattern, Controller#Actionの対応表が表示される)

リダイレクト先のアクション(例:Controller#Action の tasks#show)の行を探す

その行の Prefix 部分を確認(例: "task")。このPrefixに_pathを追加する(例:task_path)ことで、Railsが URI Pattern のパスを生成する。

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