title: Form for HABTM associations
body: <p>I have two models, Album and Image. These have has_and_belongs_to associations with eachother. An album has many images, and an image can belong to many albums. Is it correct to specify HABTM then?</p>
  
  <p>After I create an album, it redirects to the album show path. On this page, I would like to allow the user to add (upload) images to the album. However, I'm not sure how to specify the form for this. I'm using simpleform. I tried something like this (haml):</p>
  
  <pre><code>  = simple_form_for [:admin, @album] do |a|
      = a.simple_fields_for :images do |i| 
        = i.input :title
        = i.file_field :image
        = i.submit
  </code></pre>
  
  <p>But that just updates the album and doesn't create the image. I also got an error saying "Image expected, got Array".</p>
  
  <p>I would like to allow my users to upload images directly on the album show page. It feels wrong to have a separate image upload page where they specify the album. Makes a huge difference in UX, in my mind.</p>
  
  <p>Or.. I guess I could have a link saying 'add image' and when clicked, render a partial, say <code>image/_upload_form</code> in a modal? That's a backup plan however. Looking for a solution for the image form on the album show page. Thanks.</p>