Created
October 14, 2025 06:14
-
-
Save overdrivemachines/18ab18a986f1db4ec1fe6fbfb37b90ba to your computer and use it in GitHub Desktop.
routes.rake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task routes: :environment do | |
| Rails.application.eager_load! | |
| models = ApplicationRecord.descendants.collect(&:name).join("|").downcase | |
| controllers = ApplicationController.descendants.collect(&:name) | |
| controllers = (controllers.map { |controller| controller[0..-11].downcase }).join("|") | |
| if models | |
| puts `bundle exec rails routes -g "#{models}|#{controllers}"` | |
| else | |
| puts `bundle exec rails routes -g "#{controllers}"` | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment