How to rescue page not found 404 in rails?
问题 How to rescue page not found if user add wrong url in rails. I hope to show 404 page present in public folder if the url is invalid. How to do that? I was browsing about it but could not find a solution. I tried many ways to fix the problem, but they don't seem to be working. I am stuck here, please help. 回答1: Solution for Rails 4 On routes.rb : get '*unmatched_route', to: 'application#not_found' On application_controller.rb : def not_found # Your exception handling code here end 回答2: i found