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 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!