This project is archived and is in readonly mode.

#561 ✓resolved
Sam Oliver

Date select helpers should have a :prompt option

Reported by Sam Oliver | July 7th, 2008 @ 01:13 PM

It should be possible to include a custom :prompt with the date select helpers in the same way you can include one with collection_select.

Including a prompt as the first select option is common practice when using date selects. Without this feature it's tricky to use the date select helpers if you need a custom prompt.

I've included a patch with tests and documentation. With this patch you can pass custom prompts as a hash, or pass true for a generic prompt (Day, Month, Year, Hour, Minute, Seconds).

Example:

date_select("post", "written_on", :prompt=>true)
date_select("post", "written_on", :prompt=>{:day=>'Select day', :month=>'Select month', :year=>'Select year'})

http://github.com/samoli/rails/c...

Comments and changes to this ticket

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>

Referenced by

Pages