# Newbie seek for help about paperclippolymorph

**URL:** <https://www.ruby-forum.com/t/newbie-seek-for-help-about-paperclippolymorph/185041>\
**Category:** Rails\
**Created:** [March 12, 2010, 11:13am UTC](https://www.ruby-forum.com/t/newbie-seek-for-help-about-paperclippolymorph/185041 "2010-03-12T11:13:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![2tcreative](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/2/a3d4f5/32.png) [@2tcreative](https://www.ruby-forum.com/u/2tcreative)\
**Post date:** [March 12, 2010, 11:13am UTC](https://www.ruby-forum.com/t/newbie-seek-for-help-about-paperclippolymorph/185041/1 "2010-03-12T11:13:03Z")

</div>

Hi All,  
I am new to rails and I need to upload multiple images with  
paperclippolymorph [http://github.com/heavysixer/paperclippolymorph](http://github.com/heavysixer/paperclippolymorph) , I  
have a model “scene” like this:

```
 class Scene < ActiveRecord::Base
    belongs_to :user
    acts_as_polymorphic_paperclip
   # accepts_nested_attributes_for :assets, :allow_destroy => true
 end

 And the controller and view :

 class ScenesController < ApplicationController

     def create
         @scene = Scene.new(params[:scene])
         respond_to do |format|
            if @scene.save
               # bla bla ..
            else
               # bla bla
            end
         end
     end

 end

 #view:
    <% form_for(@scene, :html => { :multipart => true }) do |f| %>
          <%= f.file_field :data %> <!-- it's just a single file 

```

field,  
how to enable multiple upload? →   
\<%= f.submit “submit” %\>  
\<% end %\>

```
  I can upload single image successfully but don't know how to 

```

upload  
multiple, my question is how can I upload multiple image at once? I have  
tried with fields\_for like following and it failed, does anyone have  
idea?

\<% form\_for(@scene, :html =\> { :multipart =\> true }) do |f| %\>  
\<% f.fields\_for :assets do |asset\_field| %\>  
\<%= asset\_field.file\_field :data %\>  
\<%= asset\_field.file\_field :data %\>  
\<% end %\>  
\<% end %\>

```
    Any advice is appreciated, thanks

    Regards

```

---

<div class="post-metadata">

**Author:** ![2tcreative](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/2/a3d4f5/32.png) [@2tcreative](https://www.ruby-forum.com/u/2tcreative)\
**Post date:** [March 12, 2010, 3:12pm UTC](https://www.ruby-forum.com/t/newbie-seek-for-help-about-paperclippolymorph/185041/2 "2010-03-12T15:12:28Z")

</div>

Hi there,

I’m not a longtime Rails developper so pardon me if misunderstood your  
pb.  
But IMHO, I believe you’re looking for a solution to enable multiple  
records creation through one form.  
Why don’t you have a look at this short video:

> **[\#73 Complex Forms Part 1 - RailsCasts](http://railscasts.com/episodes/73-complex-forms-part-1)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

and probably part 2 or 3 as well,

Anyway, it helped me to sort out a rather similar problem

Hope this helps,

Christophe

Le 12 mars 2010 Ã 11:11, Xianggong a Ã©crit :

---

<div class="post-metadata">

**Author:** ![2tcreative](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/2/a3d4f5/32.png) [@2tcreative](https://www.ruby-forum.com/u/2tcreative)\
**Post date:** [March 15, 2010, 3:08am UTC](https://www.ruby-forum.com/t/newbie-seek-for-help-about-paperclippolymorph/185041/3 "2010-03-15T03:08:49Z")

</div>

thank you Christophe, it’s really helpful, and it works for me.
