Hi,
I am doing the following:
<% obj.contracts.each do |@contract| -%>
...
<%= hidden_field("contract[]", :contractor_id, :index =>
@contract.contractor.id) %>
<%= date_select("contract[]", :starting_on, :index =>
@contract.contractor.id) %>
...
<% end -%>
Here are the request parameters:
{"commit"=>"Save",
"portfolio"=>{"starting_on(1i)"=>"2006",
"starting_on(2i)"=>"6",
"starting_on(3i)"=>"12",
"finishing_on(1i)"=>"2006",
"customer_id"=>"1",
"finishing_on(2i)"=>"6",
"finishing_on(3i)"=>"12"},
"id"=>"1", "pattern"=>"bala",
"contract"=>{"starting_on(1i)"=>"2006",
"starting_on(2i)"=>"6",
"starting_on(3i)"=>"12",
"1"=>{"contractor_id"=>"1",
"portfolio_id"=>"1"},
"finishing_on(1i)"=>"2006",
"2"=>{"contractor_id"=>"2",
"portfolio_id"=>"1"},
"finishing_on(2i)"=>"6",
"finishing_on(3i)"=>"12"}}
As you can see, there are two hash keys "1" and "2", but the
dates are
not part of those hashes, but directly on the parent hash "contract".
Is this a bug in date_select helper?
Thank you,
Jean-Etienne Durand - http://www.novAgora.hu
--
Posted via http://www.ruby-forum.com/.