[act_as_attachment] upload several files/images


#1

Hi there,

im working on a site where i want to upload some (up to 4) images with
the
rails plugin “act_as_attachment”. Could anybody give me a hint, how to
design the view and the controller to process more then one upload field
with act_as_attachment?

thanks in advance

regards

purple_haze


#2

On 2/1/07, Ansgar B. removed_email_address@domain.invalid wrote:

regards

purple_haze

It’s not the greatest code, but checkout how Mephisto handles it:

http://svn.techno-weenie.net/projects/mephisto/trunk/app/views/admin/assets/new.rhtml
http://svn.techno-weenie.net/projects/mephisto/trunk/app/controllers/admin/assets_controller.rb

More file fields are added with some javascript whammy jammy:

http://svn.techno-weenie.net/projects/mephisto/trunk/public/javascripts/mephisto/application.js
(look for hte Asset object).


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com