0

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

John
  • 15,418
  • 12
  • 44
  • 65
rails_id
  • 8,120
  • 4
  • 46
  • 84

1 Answers1

0

You have to handle Routing Error with rescue_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.

Community
  • 1
  • 1
thesis
  • 2,565
  • 5
  • 26
  • 37