Permalink
Browse files

Extract EmailField

  • Loading branch information...
rafaelfranca committed Jan 17, 2012
1 parent 864d757 commit 647aff9e51dca62ea793c68c5ff830c8b364aa50
@@ -904,7 +904,7 @@ def url_field(object_name, method, options = {})
# # => <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".
@@ -10,6 +10,7 @@ module Tags
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'
@@ -0,0 +1,8 @@
+module ActionView
+ module Helpers
+ module Tags
+ class EmailField < TextField #:nodoc:
+ end
+ end
+ end
+end

0 comments on commit 647aff9

Please sign in to comment.