Replies: 2 comments 2 replies
-
have you read the various guides? It looks like you found the docs here https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Rendering-exception-and-not_found-pages Why can't you just use a template which is plain html? Even if you can't do that, did you click the next link to see https://docs.mojolicious.org/Mojolicious#before_render which states that What exactly do you find difficult about the docs? i find them INCREDIBLY clear and very concise and consistent. |
Beta Was this translation helpful? Give feedback.
-
Why |
Beta Was this translation helpful? Give feedback.
-
About 12 years ago I created an application with mojolocious and then about 8 years ago I ran into some problems and migrated my application to just plack and bunch of custom code. I am now trying to see if I can migrate it back. One of the problems I had was with understanding the documentation, and I am still having that problem. The first issue I have run into is I am trying to replace the default Page Not Found with custom HTML. I am not using templates and I would prefer not to start. My existing code generates the HTML just fine, I just can't figure out how to make mojolicious render it. The closest I have gotten so far is adding a before_render hook thusly:
That results in just a hash being displayed instead of a full on exception. Can anybody please tell me how to make mojolicious return my awesome HTML when a page isn't found? Bonus points for pointing towards some documentation that explains how to do it, because I looked and I couldn't find it.
Beta Was this translation helpful? Give feedback.
All reactions