aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-03-31 17:16:19 -0300
committerRafael França <rafaelmfranca@gmail.com>2016-03-31 17:16:19 -0300
commitb6c1ee0dfcb7ea8bfcac9daff0162876990665a3 (patch)
tree740994437b36bebf823176005903a6aea143d96d /actionview/lib/action_view
parent3af40b71f34c70a274e261cd6e6468c613de648e (diff)
parent316811b4d3f4e5a1a7bcd03de97c67218770e333 (diff)
downloadrails-b6c1ee0dfcb7ea8bfcac9daff0162876990665a3.tar.gz
rails-b6c1ee0dfcb7ea8bfcac9daff0162876990665a3.tar.bz2
rails-b6c1ee0dfcb7ea8bfcac9daff0162876990665a3.zip
Merge pull request #24385 from morgoth/deprecate-datetime_field_tag
Deprecate `datetime_field` and `datetime_field_tag` helpers.
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/helpers/form_helper.rb4
-rw-r--r--actionview/lib/action_view/helpers/form_tag_helper.rb4
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