I know how to handle error which RecordNotFound
But how can I handle Routing Error (No route matches [GET])?
PS in this topic I don’t find an answer – Rails – how to handle routes that don't exist ("No route matches [GET]")?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After every other route in you
config/routes.rb, add this line :Then create a controller called
ErrorsControllerand add aroutingaction where you can useparams[:url]to know which URL has caused the 404.By the way, it is a good way to see if your website has dead links.
Hope it helps !