Permalink
Browse files

Rename fieldset_tag to field_set_tag to follow the conventions from t…

…ext_area and text_field [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7423 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent fa602bb commit 73c70836515879f69a152535f3ab411acc3317b8 @dhh dhh committed Sep 9, 2007
View
@@ -11,7 +11,7 @@
* Fix layout overriding response status. #9476 [lotswholetime]
-* Add fieldset_tag for generating fieldsets, closes #9477. [djanowski]
+* Add field_set_tag for generating field_sets, closes #9477. [djanowski]
* Allow additional parameters to be passed to named route helpers when using positional arguments. Closes #8930 [ian.w.white@gmail.com]
@@ -369,16 +369,16 @@ def image_submit_tag(source, options = {})
# <tt>legend</tt> will become the fieldset's title (optional as per W3C).
#
# === Examples
- # <% fieldset_tag do %>
+ # <% field_set_tag do %>
# <p><%= text_field_tag 'name' %></p>
# <% end %>
# # => <fieldset><p><input id="name" name="name" type="text" /></p></fieldset>
#
- # <% fieldset_tag 'Your details' do %>
+ # <% field_set_tag 'Your details' do %>
# <p><%= text_field_tag 'name' %></p>
# <% end %>
# # => <fieldset><legend>Your details</legend><p><input id="name" name="name" type="text" /></p></fieldset>
- def fieldset_tag(legend = nil, &block)
+ def field_set_tag(legend = nil, &block)
content = capture(&block)
concat(tag(:fieldset, {}, true), block.binding)
concat(content_tag(:legend, legend), block.binding) unless legend.blank?
@@ -158,21 +158,21 @@ def test_pass
assert_equal 1, 1
end
- def test_fieldset_tag
+ def test_field_set_tag
_erbout = ''
- fieldset_tag("Your details") { _erbout.concat "Hello world!" }
+ field_set_tag("Your details") { _erbout.concat "Hello world!" }
expected = %(<fieldset><legend>Your details</legend>Hello world!</fieldset>)
assert_dom_equal expected, _erbout
_erbout = ''
- fieldset_tag { _erbout.concat "Hello world!" }
+ field_set_tag { _erbout.concat "Hello world!" }
expected = %(<fieldset>Hello world!</fieldset>)
assert_dom_equal expected, _erbout
_erbout = ''
- fieldset_tag('') { _erbout.concat "Hello world!" }
+ field_set_tag('') { _erbout.concat "Hello world!" }
expected = %(<fieldset>Hello world!</fieldset>)
assert_dom_equal expected, _erbout

0 comments on commit 73c7083

Please sign in to comment.