ターミナル上で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 のパスを生成する。