From 4cfdd238ed3bc7d4f54faab923dbceeeb7a4bced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 16 Jan 2012 21:37:31 -0300 Subject: Extract TelField --- actionpack/lib/action_view/helpers/form_helper.rb | 2 +- actionpack/lib/action_view/helpers/tags.rb | 1 + actionpack/lib/action_view/helpers/tags/tel_field.rb | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 actionpack/lib/action_view/helpers/tags/tel_field.rb (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 4348d36def..0626ff4d85 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -885,7 +885,7 @@ module ActionView # # => # def telephone_field(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("tel", options) + ActionView::Helpers::Tags::TelField.new(object_name, method, self, options).render end alias phone_field telephone_field diff --git a/actionpack/lib/action_view/helpers/tags.rb b/actionpack/lib/action_view/helpers/tags.rb index a60d263cae..fcd8f6ff36 100644 --- a/actionpack/lib/action_view/helpers/tags.rb +++ b/actionpack/lib/action_view/helpers/tags.rb @@ -8,6 +8,7 @@ module ActionView autoload :HiddenField, 'action_view/helpers/tags/hidden_field' autoload :FileField, 'action_view/helpers/tags/file_field' autoload :SearchField, 'action_view/helpers/tags/search_field' + autoload :TelField, 'action_view/helpers/tags/tel_field' autoload :TextArea, 'action_view/helpers/tags/text_area' autoload :CheckBox, 'action_view/helpers/tags/check_box' autoload :RadioButton, 'action_view/helpers/tags/radio_button' diff --git a/actionpack/lib/action_view/helpers/tags/tel_field.rb b/actionpack/lib/action_view/helpers/tags/tel_field.rb new file mode 100644 index 0000000000..87c1f6b6b6 --- /dev/null +++ b/actionpack/lib/action_view/helpers/tags/tel_field.rb @@ -0,0 +1,8 @@ +module ActionView + module Helpers + module Tags + class TelField < TextField #:nodoc: + end + end + end +end -- cgit v1.2.3