When a user of my website reaches a page that doesn’t exist, the
404.html page is rendered and the header status 404 is sent.
I’d like to have this 404 page dynamic, e.g. I’d like to display the
user a mailto link with subject that contains the actual link of the
document that was not found:
I think you can overwrite the 404.html file in the public dir, though
that wouldn’t give you full access to the rails env.
I think you could also set up a catch all route and direct to a
specific action, which would in essence work as a 404. In that action
you’d have to set the 404 status and return the page.
There is more than likely a simpler way that I’m just unfamiliar with
that someone will be swooping in with, but those were just the two
ideas that came to the top of my head.