When deleeting a post, delete all comments too

i can’t quite figure out how to delete all of a posts comments along
with deleting the post. ive set up comments as belonging to posts and
posts as having many comments and…


…works fine i just can’t figure out any way to delete that posts
comments as well. comments uses the standard foreign key of post_id.


In your post.rb file, add :dependent => :destroy…

has_many :comments, :dependent => :destroy

perfect, thank you!