I am trying to associate a set of uploaded pictures with a post. In my controller I am using the following code:

```
image_uploads = params[:image_uploads]
iu = ImageUpload.find(image_uploads)
@post.image_uploads = iu

```

While this does make the uploaded images accessible from `@post.image_uploads`, I think it doesn't associate these images with the post because when the post is deleted, the image uploads are not deleted -- even though I have used `:dependent=>:destroy` for their relationships.

```
> Post.first.delete
=>[]
> ImageUpload.all
=> [#<ImageUpload id: 3 ...>] 

```

And this is the model:

```
class Post < ActiveRecord::Base
 has_many :image_uploads, :dependent => :destroy

end

class ImageUploads < ActiveRecord::Base
 belongs_to :post

end

```

What can I do to make sure that cascading deletes work?