diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-16 21:43:06 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-17 00:05:30 -0300 |
commit | 647aff9e51dca62ea793c68c5ff830c8b364aa50 (patch) | |
tree | 3b6a54e992de268e8b8162ad45c969e52fef3f1a | |
parent | 864d7575a3908f14ffc2830a6b2ea78a98756079 (diff) | |
download | rails-647aff9e51dca62ea793c68c5ff830c8b364aa50.tar.gz rails-647aff9e51dca62ea793c68c5ff830c8b364aa50.tar.bz2 rails-647aff9e51dca62ea793c68c5ff830c8b364aa50.zip |
Extract EmailField
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/tags.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/email_field.rb | 8 |
3 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 110b6b433b..ab957597cd 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -904,7 +904,7 @@ module ActionView # # => <input id="user_address" size="30" name="user[address]" type="email" /> # def email_field(object_name, method, options = {}) - InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("email", options) + ActionView::Helpers::Tags::EmailField.new(object_name, method, self, options).render end # Returns an input tag of type "number". diff --git a/actionpack/lib/action_view/helpers/tags.rb b/actionpack/lib/action_view/helpers/tags.rb index 68bf8910c1..eb48625f80 100644 --- a/actionpack/lib/action_view/helpers/tags.rb +++ b/actionpack/lib/action_view/helpers/tags.rb @@ -10,6 +10,7 @@ module ActionView autoload :SearchField, 'action_view/helpers/tags/search_field' autoload :TelField, 'action_view/helpers/tags/tel_field' autoload :UrlField, 'action_view/helpers/tags/url_field' + autoload :EmailField, 'action_view/helpers/tags/email_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/email_field.rb b/actionpack/lib/action_view/helpers/tags/email_field.rb new file mode 100644 index 0000000000..45cde507d7 --- /dev/null +++ b/actionpack/lib/action_view/helpers/tags/email_field.rb @@ -0,0 +1,8 @@ +module ActionView + module Helpers + module Tags + class EmailField < TextField #:nodoc: + end + end + end +end |