I have a form that contains a file upload and a 2 text
fields.
<li><%= t.file_field :artwork %></li>
<li><%= t.text_field :caption %></li>
<li><%= t.text_field :tags %></li>
When I submit the form with a file upload, and filling in the 2
other fields, the "caption" field drops from the posted fields.
Processing Admin::Campaigns::AdvertisementsController#create (for 127.0.0.1 at 2009-03-07 12:14:14) [POST]
Parameters: {"campaign_advertisement"=>{"artwork"=>#<File:/var/folders/PD/PDwtDVH6G1qCmfQOwD-Og++++TI/-Tmp-/RackMultipart.15675.0>}, "tags" => "foo bar", "commit"=>"post", "campaign_id"=>"1", "authenticity_token"=>"Y0gwv6Ev9DdH4mgLAN86y+W+rMQOR2GsMoSqHKCdqoE="}
But if I submit the form without the file upload, the
"caption" field comes through.
Processing Admin::Campaigns::AdvertisementsController#create (for 127.0.0.1 at 2009-03-07 12:17:37) [POST]
Parameters: {"campaign_advertisement"=>{"artwork"=>nil, "caption"=>"asdfasdfasdf", "tags" => "foo bar"}, "commit"=>"post", "campaign_id"=>"1", "authenticity_token"=>"Y0gwv6Ev9DdH4mgLAN86y+W+rMQOR2GsMoSqHKCdqoE="}
I have no tricky javascript going on that would cause something
like this. I'm running rails 2.3.0 rc1. I have tried rc2 but
couldn't even get that working. (params wherent working, i.e.
name="member[userame]" wasnt being turned into { :members =>{
:username => 'foo' }}.
I also noticed that If I switch the position of "tags" and
"caption" around, so it reads:
<li><%= t.file_field :artwork %></li>
<li><%= t.text_field :tags %></li>
<li><%= t.text_field :caption %></li>
"tags" is now dropped from the posted fields. It would seem any
field directly after the file upload is being dropped from
post.