Rails is supposed to magically see that a request is a “DELETE” versus “GET” request, right?
I can hit http://localhost/controller/destroy/1 and it’ll delete the record. How do developers typically prevent such silly deleting?
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.
It’s good practice to remove the following generated routes from the bottom of your routes file:
As these can leave doors open to guessable, destructive actions like destroy. I try to be explicit about which routes are allowed by using named routes and
map.resources