Have you ever wondered what happens when you visit a URL (say /posts/5) in your Rails app? How does the Rails router know where to send your users?
The first (of many) step is to compare the URL against the routes table for potential matches. To make this lookup as fast as possible, the routes table is pre-compiled into a finite state machine, specifically a nondeterministic finite automaton (NFA).
If that sounds very intimidating, don't worry! The Rails router actually comes with a debugging tool that could generates an interactive visualization of your router NFA.
To generate one for your app, simply run Rails.application.routes.router.visualizer from your Rails console and save the returned string into an html file. (You will need the dot command-line tool for this – OS X users can get it from homebrew with brew install graphviz.)
Oh, is it not working? I forgot to mention that this tool is broken on Rails 5 by an internal refactor. Don't worry though, because Seth fixed it for us in this pull request, which would come out with the next 5.0 patch release. If you are impatient, you could try it out by running the 5-0-stable branch.
Before you build your next billion-dollar startup with this awesome tool, please note that this is an undocumented (private!) API, and as you can see, could break unexpectedly between versions (or go away entirely).
While it's definitely not Production Grade™ software, it's still very useful for learning and debugging purposes. Enjoy it while it lasts!