Have a look at this: http://dev.rubyonrails.org/ticket/847.
> 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| %>
> <tr>
> <td>
> <%= select("formacio[]","titulacio_id",
@titulacions
> ,{:include_blank => true }) %>
> </td>
> <td>
> <%= select("formacio[]","centre_id", @centres
,{:include_blank =>
> true }) %>
> </td>
> <td>
> <%= date_select("formacio[]", "finalitza_on" )
%> <br>
> </td>
> <td>
> </td>
> <td>
> <%= link_to "Borrar",{ :action =>
"borrar_formacio", :id =>
> @persona, :f_id => @formacio } %>
> </td>
> </tr>
> <% 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?
>
>
> ------------------------------
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
> End of Rails Digest, Vol 15, Issue 85
> *************************************
>