diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2013-01-14 12:18:36 -0800 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2013-01-14 12:18:36 -0800 |
commit | 1dd89250d12aba01d605af270201371e5cec89a4 (patch) | |
tree | cd2310f0f9bdaf6d6166f2eae6f1bdd921a116c9 /actionpack/lib/action_view/helpers/date_helper.rb | |
parent | bf095770e561c51cebeb5a556afc03a21d9e603c (diff) | |
parent | 1fecaf15d779151defecf3eadda2b4524f7f5703 (diff) | |
download | rails-1dd89250d12aba01d605af270201371e5cec89a4.tar.gz rails-1dd89250d12aba01d605af270201371e5cec89a4.tar.bz2 rails-1dd89250d12aba01d605af270201371e5cec89a4.zip |
Merge pull request #8938 from colinbm/date_select_value
Rename :value to :selected for date_select, and add missing tests/docs
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/date_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 1fbf61a5a9..cf978d8e83 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -193,6 +193,7 @@ module ActionView # * <tt>:include_blank</tt> - Include a blank option in every select field so it's possible to set empty # dates. # * <tt>:default</tt> - Set a default date if the affected date isn't set or is nil. + # * <tt>:selected</tt> - Set a date that overrides the actual value. # * <tt>:disabled</tt> - Set to true if you want show the select fields as disabled. # * <tt>:prompt</tt> - Set to true (for a generic prompt), a prompt string or a hash of prompt strings # for <tt>:year</tt>, <tt>:month</tt>, <tt>:day</tt>, <tt>:hour</tt>, <tt>:minute</tt> and <tt>:second</tt>. @@ -234,6 +235,10 @@ module ActionView # # which is initially set to the date 3 days from the current date # date_select("article", "written_on", default: 3.days.from_now) # + # # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute + # # which is set in the form with todays date, regardless of the value in the Active Record object. + # date_select("article", "written_on", selected: Date.today) + # # # Generates a date select that when POSTed is stored in the credit_card variable, in the bill_due attribute # # that will have a default day of 20. # date_select("credit_card", "bill_due", default: { day: 20 }) |