Bug in date_select

Hello:

I have a problem with dateHelper date_select. I think this is a bug.

In a form, I’ve to list many objects of type “formacio” that a “persona”
have.

“formacio” object have an “id”, two foreing key “centre_id” and
“titulacio_id” and a “finalitza_on” date.

The form have to be used to update attributes of all “formacions” of a
“persona”.

In a form I have this code:

<% @persona.formacions.each do |@formacio| %>

<%= select("formacio[]","titulacio_id", @titulacions ,{:include_blank => true }) %> <%= select("formacio[]","centre_id", @centres ,{:include_blank => true }) %> <%= date_select("formacio[]", "finalitza_on" ) %>
<%= link_to "Borrar",{ :action => "borrar_formacio", :id => @persona, :f_id => @formacio } %> <% end %>

Whell, the indexation with [] go pretty well with “titulacio_id” and
“centre_id” but not with “finalitza_on”.

The params generated for two objects “formacio” with ids “25” and “26”
are:

Parameters: {“formacio”=>{
“finalitza_on(2i)”=>“3”,
“finalitza_on(3i)”=>“5”,
“25”=>{“centre_id”=>"", “titulacio_id”=>“2”},
“26”=>{“centre_id”=>"", “titulacio_id”=>“3”},
“finalitza_on(1i)”=>“1983”},
“commit”=>“Actualitza”,
“id”=>“9”
}

But what I need is:

Parameters: {“formacio”=>{
,
“25”=>{ “centre_id”=>"",
“titulacio_id”=>“2”,
“finalitza_on(2i)”=>“3”,
“finalitza_on(3i)”=>“5”,
“finalitza_on(1i)”=>“1983”
},
“26”=>{ “centre_id”=>"",
“titulacio_id”=>“3”
“finalitza_on(2i)”=>“6”,
“finalitza_on(3i)”=>“3”,
“finalitza_on(1i)”=>“1985”
},
“commit”=>“Actualitza”,
“id”=>“9”
}

More information about my system:

$ ruby -v
ruby 1.8.4 (2005-10-29) [i486-linux]

$ dpkg -l rails
++±===================-===================-============================
ii rails 0.14.3-1 MVC ruby based framework

I’m using mysql on a Debian GNU/linux

$ mysql -V
mysql Ver 14.7 Distrib 4.1.15, for pc-linux-gnu (i486) using readline
5.0

What’s going wrong?

I too have this problem. My ruby and rails are the same version as
lumen.

Does anyone have a fix for this problem?

I can’t help you with your problem, but you may want to look at
DateBocks which provides a much nicer way of entering dates, including a
pop-up calendar:

Mick S. wrote:

I can’t help you with your problem, but you may want to look at
DateBocks which provides a much nicer way of entering dates, including a
pop-up calendar:

O'Reilly Media - Technology and Business Training

Thanks Mike, DateBocks fix it and have more functions. The problem now
is when i have multiple datebocks only the first one is working, the
calender/date formating aren’t working for the rest. How to fix this?