Today I Learned

A Hashrocket project

Grep Rails Routes

This week I found a treasure inside the Hashrocket Dotmatrix; behold:

# .zshrc
alias groutes='rake routes | grep $@'

This aliases rake routes | grep [foo], which I frequently use to search through big Rails routes files.

It looks like the Rails core team is responding to this pattern in Rails 5:

https://github.com/rails/rails/issues/18902

In the meantime, patch it yourself and reap the benefits.

h/t Dorian Karter & Jon Allured

Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.