I'm writing an app where several of the routes should only be accessible from localhost. It looks like this is possible with the new routing system.
http://www.railsdispatch.com/posts/rails-3-makes-life-better
This has examples of restricting routes based on IP address, and setting up an IP address blacklist for your routes, but I'm interested in a whitelist with just one IP address.
It would be cool if something like this worked:
get "/posts" => "posts#show", :constraints => {:ip => '127.0.0.1'}
But it didn't. Am I just missing the right syntax?