Reputation: 595
Hi am i am working on a RoR project with ruby-2.5.0 and rails 5. I am working on the API i have to write a api to upload multiple images using paperclip. I am using postman i am able to select multiple images from postman but when i send the request i got only one image last image which i selected. How can i upload multiple images?. Please check the screenshot.
Thanks in advance.
Upvotes: 1
Views: 1756
Reputation: 6531
Change field name like pictures[]
upload multiple images there.
At controller side
params[:pictures].each do |picture|
Model.create(picture: picture)
end
Upvotes: 7