Date_select() in collection

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 D. - http://www.novAgora.hu

It seems that date_select() helper does not take in consideration the
“[]”, and does not generate the value properly in the hash…

Jean-Etienne wrote:

It seems that date_select() helper does not take in consideration the
“[]”, and does not generate the value properly in the hash…

See ticket http://dev.rubyonrails.org/ticket/3811 in rubyonrails. I am
wonder why SO USEFUL patch is ignored by RubyOnRails developers.

Is any chance to solve problem with prefix in select_date()??? Because I
had such problem about 6 month ago and I HAD TO FIX this problem by
myself. I even wrote patch and add to RoR trac. But patch from Bob S.
solves this as well as other problems.

So question again. Is any chance that BUG in RoR sources will be fixed
in near future??