Forum: Ruby on Rails How to get informative blanks in date_select?

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.
C36cc320477e8d66a984bb0581449ad1?d=identicon&s=25 Martijn Vos (Guest)
on 2008-12-10 13:43
(Received via mailing list)
I want something really simple: I want a date_select that has
blanks (:include_blanks works fine so far), but having an empty
value in the select box on the webpage is ugly, so I want something
more informative there, like "month" or "select a month" or something.

In other words:

<select id="user_birthdate_2i" name="user[birthdate(2i)]">
<option value="">Month</option>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>

How do I do that? I can't find any way to accomplish this in any
docs nor in the source, yet it seems like a really obvious thing
to want to do.


Martijn.
This topic is locked and can not be replied to.