Skip to content

Instantly share code, notes, and snippets.

@dchymko
Last active April 6, 2017 02:23
Show Gist options
  • Save dchymko/1bb1d17626d4271fbeb17a8881b8e25a to your computer and use it in GitHub Desktop.
Save dchymko/1bb1d17626d4271fbeb17a8881b8e25a to your computer and use it in GitHub Desktop.
Stetch Goals Lighthouse Labs W05D01

Stretch Goals

1) Create a Delete Post button

  • 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

2) Create an "Update Post" button

  • 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?

3) Secure the Delete Post button

  • 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

4) Add some stats to the User page

  • 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

5) Pick a lab partner and link your two apps together

  • See the walkthrough for more info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment