Forum: Ruby on Rails datetime_select => "<select name="orderyearmonthdayhourminut

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ba3a00606eb530dcab2c4a6a59bf366d?d=identicon&s=25 Alain Ravet (Guest)
on 2007-03-02 02:28
(Received via mailing list)
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
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-09-25 23:00
(Received via mailing list)
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
Ba3a00606eb530dcab2c4a6a59bf366d?d=identicon&s=25 Alain Ravet (Guest)
on 2007-09-25 23:05
(Received via mailing list)
> 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
Ba3a00606eb530dcab2c4a6a59bf366d?d=identicon&s=25 Alain Ravet (Guest)
on 2007-09-25 23:10
(Received via mailing list)
> 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
This topic is locked and can not be replied to.