Multiple File Uploads with Paperclip & Rails 3 (Screencast)
Head over to Github and grab the full source of this application. More show notes will be online soon.
-
Laen
5:37 AM on Saturday, February 19th, 2011
Thanks! This is excellent.
-
Adam21e
9:49 AM on Wednesday, March 9th, 2011
Thanks for the great screencast, much appreciated. :-)
I was wondering if you knew how to add validations to the model (eg validates :title, :presence => true) and have the attachments preserved if the title is missing so they don't need to be uploaded again.
-
David Tidwell
8:27 AM on Thursday, March 10th, 2011
Hi, just wanted to thank you for this. I watched your tutorial before, but it was back in rails 2, so I'm really excited to watch this in rails 3!
-
Chris
8:41 AM on Thursday, April 21st, 2011
How do you show these images in the views. When I do post.assets[0].url I get url is an undefined method. How else could you grab the url to generate an image with the image tag outside of the form as shown in the screencast?
-
seamusjr
9:56 PM on Sunday, August 14th, 2011
Great tutorial for adding multiple images to models with paperclip in rails 3. To answer Chris's question, you can do this in the show page to iterate through your image collection.
-
seamusjr
10:01 PM on Sunday, August 14th, 2011
To answer Chris's question, you can do this in the show page to iterate through your image collection:
https://gist.github.com/1145350 -
rmagnum2002
11:10 PM on Wednesday, September 7th, 2011
https://gist.github.com/1145350
this isn't working..
gave me an error
undefined method `assets' for nil:NilClass
Extracted source (around line #12):
9:
10:
11:
12:
...please help. thanks
-
rmagnum2002
12:46 PM on Thursday, September 8th, 2011
how can you take one asset to the index.html?
I mean display a thumb next to the post.
And how can you limit the upload files? cause I can upload 5 then edit the post and upload 5 more and so on.. ending up having more images than needed -
Emils
5:09 PM on Wednesday, September 21st, 2011
Great screencast !
But
When I try to upload an image, I get - ActiveRecord::UnknownAttributeError (unknown attribute: image).Anyone has this issue?
Any solutions ?I noticed that this app from git hub is on rails 3.0.3 (My app 3.1.0) - Could this be the case ?
Thanks!
-
Hunter Husar
1:14 AM on Thursday, October 6th, 2011
Thank you! Very great tutorial very helpful :) !
-
Gordon Yeong
8:12 AM on Monday, October 10th, 2011
thanks for doing this. I too did multi images uploads using rails 2.3.8 but with a new project on rails 3, your guide provided me opportunity to further simplify my code. On rails 2.3.8, i relied on js to dynamically create more file fields in the view but with yours, i just calculated the number of new file fields required when the 'update' message is sent to the resource controller :)
Sweet :D -
Prashanth
5:12 AM on Sunday, December 18th, 2011
Great screencast, saved my day!!
Keep them coming :)
-
Steve
1:30 AM on Wednesday, December 28th, 2011
Thanks for this screencast. VERY helpful. I seem to be having a problem with displaying the attachments in my show view. Can you email me the code you use in your show view? I appreciate your work on this topic.