DEV Community

Cover image for Of Course I Need Fun Routes! 🌈
Anna Villarreal
Anna Villarreal

Posted on

6 1

Of Course I Need Fun Routes! 🌈

*general excitement*


Another one of my little tangent side quests here. I'll admit I had to do a little digging to figure this one out. It has no real purpose other than it's awesome and I had fun doing it. You may like it too.

When you run rails routes, you get a swath of white text in your terminal that isn't all that fun to look at. Additionally, it often will run on to the next line and it's a little haphazard feeling unless you zoom way out and then make your terminal gigantic. Can't have that. It has to be fun. (Or you know, stylized to your taste, 10 shades of whatever your brand is.) XD

Turn this:

regular routes

Into this:

fun routes

So I messed around a bit...

colored lines

Ok, things are happening. You can easily add structure by calling rails routes --expanded

expanded rainbow routes

Now were cooking with fire.

If this can be done, it means I can break it apart and put colors in places I want them. Excellent.

Lets take one part of the route, lets say the path for example. We can make a color array to loop over the characters.

rainbow paths

This is totally my vibe.


But can it be useful?

How about we highlight the verbs and slap the controller below it so it's not so squished in the terminal.

excellent routes

Now we can find the routes a bit easier with verb highlighting. Perf.

The point here is, you can tweak it, and it can be sort of helpful.

If you are interested in poking around with this, my rake file can be found here: Rainbow Routes

Thanks for looking!

I'd like to hear everyones 2 cents on the matter. Does anyone else do this? 🀣

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (2)

Collapse
 
bibimbop123 profile image
Brian Kim β€’

Not gonna lie I did find that pretty cool! Thanks for sharing Anna!

Collapse
 
annavi11arrea1 profile image
Anna Villarreal β€’

Thanks!

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay