Small commit, but it's a doozy with interesting and important implications. And metaprogramming.
Essentially, my main goal was to get url_for(@location) working, as well as location_path(@location). Rails doesn't easily let you mess with path helpers, but you can metaprogram your way into them.
This was way less painful than I expected, but now there is some untested and very brittle code in routes.rb. I'm gonna try and test it now.