Scott I have stuggled with the same problem. Ultimately I have resorted
to file_column, a plugin that can handle multiple files. You can find it
at http://www.kanthak.net/opensource/file_column/ .
To handle multiple files, you should put something like the following in
your model:
class Entry < ActiveRecord::Base
file_column :image1
file_column :image2
file_column :image3
end
Kind regards,
Nick
scottnj wrote:
I am trying to modify the image upload example in the Agile book to
handle mtltiple files.
I have been playing with it for a while now, but no luck.
Do I have to create a loop, and do each file seperate, or can I just
save an array of files?
How can I set up my form and controller to handle this? Will I have to
modify the model?
I am trying to modify the image upload example in the Agile book to
handle mtltiple files.
I have been playing with it for a while now, but no luck.
Do I have to create a loop, and do each file seperate, or can I just
save an array of files?
How can I set up my form and controller to handle this? Will I have to
modify the model?
I used the following js to create a dynamic array of files and then loop
through
the array. (stickman’s multiple upload javascript) http://snipurl.com/ko7u
then use something like:
@files = []
params[:file].each {|k,v| @files[k.to_i] = v if v.size>0}
I used the following js to create a dynamic array of files and then loop
through
the array. (stickman’s multiple upload javascript) http://snipurl.com/ko7u
I saw this and am considering it, but I need something to work if
javascript is disabled.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.