I'm attempting to clean up any routes, controller actions, and views that literally never get used in an application (that is, they'd be impossible to visit unless a user happened to guess the route).
(these sometimes appear because I think I'll need it, so set up the route, action, and view, then work takes a different direction and it doesn't get used)
The problem is how do I confidently tell if a certain route is ever linked to in an app?
What I already know
If the route looked like this
# routes.rb
'payments-setup-status' => 'user#payments_setup_status'
Then I could search the entire repository for payments-setup-status
and for payments_setup_status_url
and payments_setup_status_path
. If I find no links to it, then assume it's unused anywhere in the app.
I am not sure what else I could do, or if there is some more 'intelligent' way of figuring out which routes/actions/views are not used in an application?
question from:
https://stackoverflow.com/questions/65886533/how-to-tell-if-a-route-method-view-ever-gets-used 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…