This project is archived and is in readonly mode.
select_datetime :order results in extra fields
Reported by Bryan Larsen | April 24th, 2009 @ 03:39 PM
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.
Comments and changes to this ticket
-
Michiel de Mare June 11th, 2009 @ 10:01 PM
So now select_date renders the time, and select_time already renders the date controls, if you specify the order. Bleh.
-
Bryan Larsen June 11th, 2009 @ 10:16 PM
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.
-
Bryan Larsen June 11th, 2009 @ 10:16 PM
- Tag set to patch
-
Rohit Arondekar October 14th, 2010 @ 10:52 AM
- 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?
-
Bryan Larsen November 19th, 2010 @ 07:17 PM
- Tag set to 2.3.x, patch
Problem still exists in 2-3-stable
-
Josh Kalderimis February 13th, 2011 @ 02:47 PM
- 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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>