Lots of requests but not many answers on this topic. Here is how you do
it:
FORM:
Title | " name="<%= "picture[#{i}][title]" %>" size="30" type="text" /> |
Image | " name="<%= "picture[#{i}][image_data_temp]" %>" type="hidden" /> " name="<%= "picture[#{i}][image_data]" %>" size="30" type="file" /> |
CONTROLLER:
params[:picture].each { |attr, value|
unless value[:image_data].blank?
new_image = Image.new
new_image.person_id = session[:person_id]
new_image.title = value[:title]
new_image.image = value[:image_data]
new_image.save
end
}
MODEL:
class Image < ActiveRecord::Base
file_column :image
end