Best way to handle 404s in a defined route #313
willowlight
started this conversation in
General
Replies: 1 comment 1 reply
-
You can also use the plugin :not_found do
view '404'
end in your route: view :single if @content By default, the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the not_found plugin installed which works great for non-defined routes. But if I have a route that is defined such as
/news/:id
But then the :id is non-existent in the database, what's the best way to turn it into a 404 and keeping it DRY?
Currently I'm doing this, which just shows a 404 view, but does not have the correct response header:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions