Hi,
We've had some requests though for nonsense URLs which have slipped through to our controllers and caused ActionView::MissingTemplate exceptions. They're from URLs like
/artists/123-radiohead.php
I feel like it should be possible to block this request at the routing stage - before it reaches the artists controller, but I can't see how it could be done. We use restful routes, so the artists controller is wired up using
map.resources :artists
Is there any way to add an option to this call to specify the formats that are acceptable (and thus return a 40x code if the format is not in the whitelist?)
e.g.
map.resources :artists, :format => [ :html, :json ]
I can't see anything in the docs, or indeed the code, which would let me do this, but I might well have missed something.
cheers, Matt