Permalink
Browse files

Extract UrlField

  • Loading branch information...
1 parent 4cfdd23 commit 864d7575a3908f14ffc2830a6b2ea78a98756079 @rafaelfranca rafaelfranca committed Jan 17, 2012
View
2 actionpack/lib/action_view/helpers/form_helper.rb
@@ -895,7 +895,7 @@ def telephone_field(object_name, method, options = {})
# # => <input id="user_homepage" size="30" name="user[homepage]" type="url" />
#
def url_field(object_name, method, options = {})
- InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("url", options)
+ ActionView::Helpers::Tags::UrlField.new(object_name, method, self, options).render
end
# Returns a text_field of type "email".
View
1 actionpack/lib/action_view/helpers/tags.rb
@@ -9,6 +9,7 @@ module Tags
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 :UrlField, 'action_view/helpers/tags/url_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'
View
8 actionpack/lib/action_view/helpers/tags/url_field.rb
@@ -0,0 +1,8 @@
+module ActionView
+ module Helpers
+ module Tags
+ class UrlField < TextField #:nodoc:
+ end
+ end
+ end
+end

0 comments on commit 864d757

Please sign in to comment.