Is there a way to make "rake routes" look better?

Viewed 9577

I am always forced to make my terminal window two dual monitors wide just to see read them right. I'm not a stickler for buttery GUI's, but this is ridiculous.

Is there a pretty print for this command?

9 Answers

Rails 6+

For those, who anyway want to use their terminal to view complicated rails routes.

Rails 6 introduced --expanded option to print them in a more convenient way.

Here is an example:

$ rails routes --expanded
--[ Route 1 ]------------------------------------------------------------
Prefix            | high_scores
Verb              | GET
URI               | /high_scores(.:format)
Controller#Action | high_scores#index
--[ Route 2 ]------------------------------------------------------------
Prefix            | new_high_score
Verb              | GET
URI               | /high_scores/new(.:format)
Controller#Action | high_scores#new
--[ Route 3 ]------------------------------------------------------------
Prefix            | blog
Verb              |
URI               | /blog
Controller#Action | Blog::Engine

[ Routes for Blog::Engine ]
--[ Route 1 ]------------------------------------------------------------
Prefix            | cart
Verb              | GET
URI               | /cart(.:format)
Controller#Action | cart#show

And a link to PR.

Related