How do I write the controller, routing, or view to present 404s when a routing error occurs?
For example,if the user access a url address
http://0.0.0.0:3000/posts/likes
The likes path isn’t a method in the routing. How do I redirect it to 404 page?
1.In the application_controller.rb
2.Create a errors folder and a file named not_found.html.erb
3.Add the source to application_controller.rb