Hi all 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: mailto:webmaster-V73p5/TkvBI@public.gmane.org?subject=Broken link - http://this-link-does-not-exist How can I achieve that? I don''t want to use JavaScript or such stuff, I''d like to have full access to the "normal" Rails environment in 404.html... Thanks Josh -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
wentwj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Oct-30 02:27 UTC
Re: How to create a dynamic 404 page?
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. On Oct 29, 6:21 pm, Joshua Muheim <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all > > 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: > > mailto:webmas...-V73p5/TkvBI@public.gmane.org?subject=Broken link -http://this-link-does-not-exist > > How can I achieve that? I don''t want to use JavaScript or such stuff, > I''d like to have full access to the "normal" Rails environment in > 404.html... > > Thanks > Josh > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---