Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

select_datetime :order results in extra fields

#2560

To reproduce

$ rails -v
Rails 2.3.2
$ rails test1
$ cd test1
$ rake db:migrate
$ script/console
>> puts helper.select_datetime(Time.now, :prefix=>"foo", :order=> [:year, :month, :day, :hour, :minute, :second]).split("\n").find_all {|s| /select /.match(s)}
<select id="foo_year" name="foo[year]">
<select id="foo_month" name="foo[month]">
<select id="foo_day" name="foo[day]">
<select id="foo_hour" name="foo[hour]">
<select id="foo_minute" name="foo[minute]">
<select id="foo_second" name="foo[second]">
<select id="foo_hour" name="foo[hour]">
<select id="foo_minute" name="foo[minute]">

As you can see, foo_hour and foo_minute appear twice.

Reported by Bryan Larsen · April 24th, 2009 @ 03:39 PM

State: wontfix
Milestone: none
Assigned to: Josh Kalderimis Josh Kalderimis
Importance: none

Activity

  1. Bryan Larsen
  2. Michiel de Mare
    Michiel de Mare

    So now select_date renders the time, and select_time already renders the date controls, if you specify the order. Bleh.

    June 11th, 2009 @ 10:01 PM

  3. Bryan Larsen
    Bryan Larsen

    Are you commenting on my patch or on rails in general? select_date currently renders the time, so you can blame my patch for exploiting it, but the problem was in the existing code. My patch is the least intrusive way of fixing the bug -- there are other ways. If you'd prefer a larger patch, just say so.

    June 11th, 2009 @ 10:16 PM

  4. Bryan Larsen
  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  6. Rohit Arondekar
    Rohit Arondekar
    • Milestone cleared.
    • Importance changed from to

    Could not reproduce on Rails 3.0. Can somebody please try this on 2.3.9 or 2-3-stable?

    October 14th, 2010 @ 10:52 AM

  7. Jeff Kreeftmeijer
    Jeff Kreeftmeijer
    • Tag cleared.

    Automatic cleanup of spam.

    November 8th, 2010 @ 08:27 AM

  8. Bryan Larsen
    Bryan Larsen
    • Tag set to 2.3.x, patch

    Problem still exists in 2-3-stable

    November 19th, 2010 @ 07:17 PM

  9. Josh Kalderimis
    Josh Kalderimis
    • State changed from new to wontfix
    • Tag changed from 2.3.x, patch to 2.3.x, action_pack, action_view
    • Assigned user set to Josh Kalderimis

    I have closed this issue as it doesn't appear on 3-0-stable or master. 2-3-stable is just for security issues at this point.

    February 13th, 2011 @ 02:47 PM