title: Rails form multiple params XML
body: <p>I have a form (snippet)</p>
  
  <pre><code>&lt;% form_for(@transfer, :html =&gt; {:multipart =&gt; true}) do |f| %&gt;
    &lt;p&gt;
      &lt;%= f.label :source %&gt;&lt;br /&gt;
      &lt;%= f.text_field :source %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= f.label :destination %&gt;&lt;br /&gt;
      &lt;%= f.text_field :destination %&gt;
    &lt;/p&gt;
  
    &lt;% fields_for :upload do |u| %&gt;
      &lt;p&gt;
        &lt;%= u.label :upload %&gt;&lt;br /&gt;
        &lt;%= u.text_field :upload %&gt;
      &lt;/p&gt;
    &lt;% end %&gt;
  
    &lt;p&gt;
      &lt;%= f.submit 'Create' %&gt;
    &lt;/p&gt;
  &lt;% end %&gt;
  
  &lt;%= link_to 'Back', transfers_path %&gt;
  </code></pre>
  
  <p>So now in my transfers controller I can do:</p>
  
  <pre><code>@transfer = Transfer.new(params[:transfer])
  @upload   = Upload.find_or_create_by_md5(params[:upload])
  </code></pre>
  
  <p>I am able to post to a single form with XML by simply changing the params to XML like</p>
  
  <pre><code>&lt;transfer&gt;
      &lt;source&gt;foo&lt;/source&gt;
      &lt;destination&gt;bar&lt;/destination&gt;
  &lt;/transfer&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;upload&gt;
      &lt;upload&gt;baz&lt;/upload&gt;
  &lt;/upload&gt;
  </code></pre>
  
  <p>But I cannot figure out how to combine them under the same XML root</p>