diff options
author | Wojciech Wnętrzak <w.wnetrzak@gmail.com> | 2016-03-31 21:46:10 +0200 |
---|---|---|
committer | Wojciech Wnętrzak <w.wnetrzak@gmail.com> | 2016-03-31 21:46:12 +0200 |
commit | 316811b4d3f4e5a1a7bcd03de97c67218770e333 (patch) | |
tree | 9cc78133b209c122d8d951a98de488aa4345eef7 /actionview/lib | |
parent | a564fecbd0c96815664067b727817045459cae98 (diff) | |
download | rails-316811b4d3f4e5a1a7bcd03de97c67218770e333.tar.gz rails-316811b4d3f4e5a1a7bcd03de97c67218770e333.tar.bz2 rails-316811b4d3f4e5a1a7bcd03de97c67218770e333.zip |
Deprecate `datetime_field` and `datetime_field_tag` helpers.
Datetime input type was removed from HTML specification.
One can use `datetime_local_field` and `datetime_local_field_tag` instead.
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/form_helper.rb | 4 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/form_tag_helper.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index e91b3443c5..7ced37572e 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -1118,6 +1118,10 @@ module ActionView # # => <input id="user_born_on" name="user[born_on]" type="datetime" min="2014-05-20T00:00:00.000+0000" /> # def datetime_field(object_name, method, options = {}) + ActiveSupport::Deprecation.warn(<<-MESSAGE.squish) + datetime_field is deprecated and will be removed in Rails 5.1. + Use datetime_local_field instead. + MESSAGE Tags::DatetimeField.new(object_name, method, self, options).render end diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index 82e9ace428..cfff0bef5d 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -691,6 +691,10 @@ module ActionView # * <tt>:step</tt> - The acceptable value granularity. # * Otherwise accepts the same options as text_field_tag. def datetime_field_tag(name, value = nil, options = {}) + ActiveSupport::Deprecation.warn(<<-MESSAGE.squish) + datetime_field_tag is deprecated and will be removed in Rails 5.1. + Use datetime_local_field_tag instead. + MESSAGE text_field_tag(name, value, options.merge(type: :datetime)) end |