Open14
rails routes の仕組みを調べる

組み込みの rake タスクの場所は以下

Rails.application.routes.routes
が何を出しているか調べる
ソースコードの場所を特定する
Rails.application.routes.method(:routes).source_location
=> ["/usr/local/bundle/gems/actionpack-7.0.3.1/lib/action_dispatch/routing/route_set.rb", 336]

:routes
は :set
の alias

ローカル開発環境でのRouting Errorページ(routeの一覧)がどのように実装されているか見る
View テンプレートを見つけた

@routes_inspector
に値をセットしてる箇所

ここの _routes
はどこで定義されてるんだろう?

実体は ActionController::Base
のインスタンス変数かな?

調べる方向を変えて
このページを出しているであろう middleware から見ていく
/usr/local/bundle/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/debug_exceptions.rb:32:in

エラーページを render しているっぽい箇所

backtrace 出してみたら、見てるところあっていそう
/usr/local/bundle/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/debug_view.rb:50:in `render'
/usr/local/bundle/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/debug_exceptions.rb:84:in `render_for_browser_request'
/usr/local/bundle/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/debug_exceptions.rb:69:in `render_exception'
/usr/local/bundle/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/debug_exceptions.rb:39:in `rescue in call'
/usr/local/bundle/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/debug_exceptions.rb:26:in `call'
/usr/local/bundle/gems/web-console-4.2.0/lib/web_console/middleware.rb:132:in `call_app'