Reputation: 21
I am having some trouble figuring out how to upload multiple images using a single form in a view. Basically, I have a form for articles on a blog that consists of a title text_field, a body text_area and a file_field for uploading a single picture using Paperclip and S3, which is all working fine.
However, I want to add more file_fields to the same form for uploading several different images, because each article needs to have more than one picture.
I've been searching for the last three days and reading through some tutorials that seemed relevant, but usually just suggested using 'html: { multipart: true }' at the start of the form or on the file_field itself, but this just gave different versions of the same image, such as :medium, :thumb, :avatar. But I think I may not have been asking the question clearly enough...
Does anyone know how to achieve this functionality? If you can point me in the right direction or have any links that will help me to achieve this I will be so grateful that I will get down on my knees and hail you as a coding prophet.
Thank you all very much in advance.
Let me know if I haven't been clear enough... and thanks again.
Upvotes: 1
Views: 1171
Reputation: 980
use gem ´carrierwave´
It works as a charm!
Here's a nice tutorial to do so.
enjoy
http://railscasts.com/episodes/253-carrierwave-file-uploads
Upvotes: 0