- Create a form in the post view. Rememebr you have to use the action
postand add a hiden input field called_methodwith the value of delete - Add a delete route in your actions RUb and find and delete (destroy) the post
- Reuse your post form partial
- make the form
PUTto a new endpoint (actions.rb) - add a new
PUTrout to update the pist similar to how you created a new one? Remember how to make changes to an Active Record model instead of creating a new one?
- Change the Delete post to only display if the post belongs to the logged in user
- Change the Delete route in actions.rb to only allow deletion of posts by the logged in user. You will need to use the
sessionfor this
- Create a
user/:idpage that will show all posts for the user (by id) and show some stats lke total number of comments and likes
- See the walkthrough for more info