How do I render a 404 or page doesn’t exist like Twitter does?
I use rails 3.2.3
My code
def rescue_with_handler(exception)
redirect_to '/500.html'
end
def method_missing(id, *args)
redirect_to '/404.html'
end
That works, but I want to be like twitter. For example if I access this page
https://twitter.com/abcd/skka/asafaga
and https://twitter.com/abcd/skka
You have to handle
Routing Errorwithrescue_from.This question was already answered:
Also there is solution here:
In any case, try to Google it, you will find a lot of different solutions.