- Create a form in the post view. Rememebr you have to use the action
post
and add a hiden input field called_method
with 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
PUT
to a new endpoint (actions.rb) - add a new
PUT
rout 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
session
for this
- Create a
user/:id
page 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