hibiken / stories

Medium clone built with Ruby on Rails
https://my-medium-clone.herokuapp.com/
MIT License
826 stars 270 forks source link

Deleting a Post #32

Open milezzz opened 8 years ago

milezzz commented 8 years ago

Thought this might be useful to someone. You can delete a post from the rails console with:

Post.find(POST_ID).destroy

Replace POST_ID with the numerical ID of your post.

I was hoping there was a method to delete a tag in the API but I don't see it.

lalo2302 commented 8 years ago

Should this be a soft delete? Maybe to have a kind of trashcan for deleted projects in case the user wanted to recover them

danleecreates commented 8 years ago

Soft delete would be a good idea

hibiken commented 8 years ago

I agree. If we can archive posts, that'd be great! Please create a PR for this if anyone ends up implementing this 👍

AjayBarot commented 7 years ago

@milezzz : Post.find(POST_ID).destroy we can use finder this way because of this gem friendly_id. Please refer this doc gem. @nearkingdom @kenny-hibino : Please review the pull request regarding this issue and provide your feedback and let me know If I miss any thing.