datetime_select => "<select name="orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent[starts_at(3i)][day]">"

Hi,

datetime_select is playing funny tricks on me and generates crazy code :

   <select name="orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent[starts_at(3i)][day]">

=> the server only receives the year and the month. The other parameters are lost.

In the view :

    <%= datetime_select :event , :starts_at %>

would generate (in the browser)

   <select name="event[starts_at(1i)]">       <option value="2003">2003</option>       ...    <select name="event[starts_at(2i)]">       <option value="1">January</option>       ...    <select name="orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent[starts_at(3i)][day]">       <option value="1" selected="selected">1</option>       ...    <select name="orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent[starts_at(4i)][hour]">       <option value="00" selected="selected">00</option>

The server can only figure out the year and month; the rest is lost. It's not a surprise when ou see the params it receives.

params =>    {"commit"=>"Wijzigen", "orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent"=>{"starts_at(3i)"=>{"day"=>"18"}, "starts_at(4i)"=>{"hour"=>"17"}, "starts_at(5i)"=>{"minute"=>"17"}}, "event"=>{"starts_at(1i)"=>"2018", "starts_at(2i)"=>"12", "id"=>"1", "hidden"=>"1"}, "action"=>"update_event", "id"=>"1", "controller"=>"admin_production", "page"=>"4"}

Googled couldn't a match       orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent

Is it just happening to me?

(I use EdgeRails and plugins)

Alain

Hi,

datetime_select is playing funny tricks on me and generates crazy code :

   <select name="orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent[starts_at(3i)][day]">

=> the server only receives the year and the month. The other parameters are lost.

In the view :

    <%= datetime_select :event , :starts_at %>

would generate (in the browser)

   <select name="event[starts_at(1i)]">       <option value="2003">2003</option>       ...    <select name="event[starts_at(2i)]">       <option value="1">January</option>       ...    <select name="orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent[starts_at(3i)][day]">       <option value="1" selected="selected">1</option>       ...    <select name="orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent[starts_at(4i)][hour]">       <option value="00" selected="selected">00</option>

The server can only figure out the year and month; the rest is lost. It's not a surprise when ou see the params it receives.

params =>    {"commit"=>"Wijzigen", "orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent"=>{"starts_at(3i)"=>{"day"=>"18"}, "starts_at(4i)"=>{"hour"=>"17"}, "starts_at(5i)"=>{"minute"=>"17"}}, "event"=>{"starts_at(1i)"=>"2018", "starts_at(2i)"=>"12", "id"=>"1", "hidden"=>"1"}, "action"=>"update_event", "id"=>"1", "controller"=>"admin_production", "page"=>"4"}

Googled couldn't a match       orderyearmonthdayhourminuteseconduse_hiddendiscard_typetrueprefixevent

Is it just happening to me?

(I use EdgeRails and plugins)

Alain

What you are seeing is a string output of a hash of values (try it in IRB, build a hash and to_s it, you’ll get the same looking jumble of words). If that’s all you have in the datetime_select call, you may have found a bug in Edge. You could try posting a bug report here: http://dev.rubyonrails.org/. I would suggest, if you can and what to, to look into the code and try to find out what’s happening with that call.

Jason

Is it just happening to me?

   > (I use EdgeRails and plugins)

Correction: it's also happening with the official release 1_2_2.

Alain Ravet

I would suggest, if you can and what to, to look into the code and try to

  > find out what's happening with that call.

As usual, Murphy's laws come into action when you're pushing for a deadline. I'll PDI once it's over.

Alain