cjm2671
cjm2671

Reputation: 19476

Multiple attachments per model with paperclip

I'm trying to integrate paperclip into a simple comment thread so users can attach files to their comments.

I understand that following the instructions that come with paperclip will end up with me being able to attach one file to one comment.

I would like to be able to attach multiple files. Do I need to create a separate 'Attachments' model with a has_many relationship?

Upvotes: 2

Views: 1170

Answers (1)

Adam Eberlin
Adam Eberlin

Reputation: 14205

Creating a separate attachment model linked by a has_many relationship is the best way to go.

Upvotes: 8

Related Questions