title: Why is assign_attributes with array of ids for has_many association only associating one object?
body: <p>I have a form where users can upload assets using ajax. This creates many Asset objects that I then want to associate with a Post object when it is created. I have a form_field named asset_ids that I update with the created Asset ids as they are created. When I create the Post object and populate its data with assign_attributes, only ONE association is created, no matter how many ids are there.</p>
  
  <p>Asset model:</p>
  
  <pre><code>class Asset &lt; ActiveRecord::Base
  
    attr_accessible :caption, :image
    belongs_to :post
    has_attached_file :image, :styles =&gt; { :large =&gt; "600x600&gt;", :medium =&gt; "300x300&gt;", :thumb =&gt; "100x100&gt;" }
  
  end
  </code></pre>
  
  <p>Post model:</p>
  
  <pre><code>class Post &lt; ActiveRecord::Base
  
      attr_accessible :content, :post_date, :status, :title, :tag_list, :asset_ids, :as =&gt; :admin
      has_many :assets, :dependent =&gt; :destroy
      has_and_belongs_to_many :tags
  
      validates :content, :post_date, :title, :presence =&gt; true
  
  end
  </code></pre>
  
  <p>An example of the posted data hash:</p>
  
  <pre><code>{"title"=&gt;"Test post", "status"=&gt;"true", "post_date"=&gt;"01/02/2013", "content"=&gt;"&amp;nbsp;Some content", "tag_list"=&gt;"", "asset_ids"=&gt;"97,102"}
  </code></pre>
  
  <p>The example above assigns only one Asset (id 97) to the new Post, when I assign_attributes like so:</p>
  
  <pre><code>@post = Post.new
  @post.assign_attributes params[:post], :as =&gt; :admin
  </code></pre>