title: Rails nested form with multiple entries
body: <p>I have a <code>Sezzion</code> model:</p>
  
  <pre><code>attr_accessible  :description
  has_many :session_instructors, :dependent =&gt; :destroy
  has_many :instructors, :through =&gt; :session_instructors
  accepts_nested_attributes_for :session_instructors
  accepts_nested_attributes_for :instructors
  </code></pre>
  
  <p><code>Instructor</code> model:</p>
  
  <pre><code>attr_accessible :bio
  has_many :sezzions, :through =&gt; :session_instructors
  has_many :session_instructors, :dependent =&gt; :destroy
  </code></pre>
  
  <p><code>SessionInstructor</code> model:</p>
  
  <pre><code>attr_accessible :instructor_id, :sezzion_id
  belongs_to :sezzion
  belongs_to :instructor
  </code></pre>
  
  <p>Lastly, <code>User</code> model:</p>
  
  <pre><code>has_many :sezzions
  has_many :instructors
  </code></pre>
  
  <p>I'm trying to create a form for <code>Sezzion</code> with nested form for <code>SessionInstructor</code> which has multiple select option for <code>Instructors</code>. </p>
  
  <p>How can I do the following:</p>
  
  <ol>
  <li>nested form for <code>SessionInstructor</code></li>
  <li>use multiple select option to get all the selected <code>Instructor</code>'s <code>instructor_id</code></li>
  <li>hidden field to pass in the created/updated <code>session_id</code> with each select instructor</li>
  </ol>
  
  <p>I have the following code as of now:</p>
  
  <pre><code>&lt;%= form_for(@sezzion) do |f| %&gt;
  
      &lt;%= f.label :description %&gt;
      &lt;%= f.text_area :description %&gt;
  
  
      &lt;%= f.label :instructors %&gt;
      &lt;%= fields_for :session_instructors do |f| %&gt;
        &lt;select multiple&gt;
          &lt;% current_user.instructors.each do |instructor| %&gt;
            &lt;option&gt;&lt;%= instructor.name %&gt;&lt;/option&gt;
          &lt;% end %&gt;
        &lt;/select&gt;
      &lt;% end %&gt;
  
      &lt;%= f.submit %&gt;
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>Thank you so much!</p>