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