How to find which engine (gem) provides the route

One of my gems, the Rails Engine, provides a route that should not be. And I would like to know what kind of pearl it is.

This is a Spree site with several extensions, so there are quite a few small engines that come with dependencies: one of them offers admin/login, which should not be. When I create the "vanilla" spree site, this route does not exist, but in my old and updated instance it exists over time.

Is there a way to quickly get a list of all routes grouped by file or the engine in which they are defined?

+4
source share
1 answer

Quick and dirty solution

, Rails . , , .

bundle show --paths , Gemfile.

, Rails- config/routes.rb, Bundler UNIX:

find `bundle show --paths` -name routes.rb | grep -v test | grep -v spec

, , ...

+1

Source: https://habr.com/ru/post/1598719/


All Articles