A reader asked if I could add the
destroy action to
CommentsController for the sample blog in Rails Crash Course. The changes are summarized below.
I created a new branch called comments-destroy and then added the destroy action.
Here are the steps I followed:
config/routes.rbto include a route for comments destroy
- Add a
- Add a Destroy link to the comment partial at
The changes are in this commit: f410496
Note this is the same as Exercise 3 at the end of Chapter 5. The answers for all exercises are in the back of the book.
Hope this helps!
One thought on “Destroying Comments”
I used your code but still facing problems. And sorry, I messed up the issue comment on github (used email to reply), and addressed you wrongly as Andrew :
Hope you can clean that up, sorry again.
Comments are closed.