aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/form_helper.rb
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2015-09-27 23:51:21 +0900
committeryui-knk <spiketeika@gmail.com>2015-09-27 23:51:21 +0900
commita314879a96a92cfdd06b0ea998fe3201fad604fa (patch)
treeb17d77ab8b2e8aadca188b6a8baf46d3ddf36c25 /actionview/lib/action_view/helpers/form_helper.rb
parent8c879b7afa7609695ce1cda3b229c7e9a572293d (diff)
downloadrails-a314879a96a92cfdd06b0ea998fe3201fad604fa.tar.gz
rails-a314879a96a92cfdd06b0ea998fe3201fad604fa.tar.bz2
rails-a314879a96a92cfdd06b0ea998fe3201fad604fa.zip
[ci skip] Fix which method `FormHelper#date_field` try to call
When this method was implemented (https://github.com/rails/rails/pull/5016/files), `to_date` is called. But this behavior was chagned refactoring (https://github.com/rails/rails/pull/6452/files). In the first commit, there were not test which asserts `to_date` is called. I think trying `to_date` is more useful than trying `strftime`, because we can write `"2015-01-01".to_date`. But first fix comments to match actual behavior.
Diffstat (limited to 'actionview/lib/action_view/helpers/form_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/form_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb
index 610f5c0b4a..2a367b85af 100644
--- a/actionview/lib/action_view/helpers/form_helper.rb
+++ b/actionview/lib/action_view/helpers/form_helper.rb
@@ -1038,7 +1038,7 @@ module ActionView
# date_field("user", "born_on")
# # => <input id="user_born_on" name="user[born_on]" type="date" />
#
- # The default value is generated by trying to call "to_date"
+ # The default value is generated by trying to call +strftime+ with "%Y-%m-%d"
# on the object's value, which makes it behave as expected for instances
# of DateTime and ActiveSupport::TimeWithZone. You can still override that
# by passing the "value" option explicitly, e.g.