Find a record with the id from the link
To find a record (site) from the id in the link,
Site.find(@params['id'])
To delete this record
Site.find(@params['id']).destroy
To find a record (site) from the id in the link,
Site.find(@params['id'])
Site.find(@params['id']).destroy
1 Comments:
Deleting a record on this way is generally a bad habbit. What if someone changes the URL? Or even worse, what about prefetching URLs?
Post a Comment
<< Home