Skip to content

HowTo: ultra mega fast rails routes lookup

2011 March 16

I was quite annoyed by the wasted time it took each time I grep the rails routes table.
Wait, can’t this be cached? – Sure it can!
So I came up this nice little alias to cache the output once:

alias route='CF=tmp/routes_cache; [[ ! -s $CF ]] && rake routes > $CF; cat $CF | grep '

now it’s ultra fast, try e.g.:

$ route root


Comments are closed.