From 73c70836515879f69a152535f3ab411acc3317b8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 9 Sep 2007 15:58:12 +0000 Subject: Rename fieldset_tag to field_set_tag to follow the conventions from text_area and text_field [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7423 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 2 +- actionpack/lib/action_view/helpers/form_tag_helper.rb | 6 +++--- actionpack/test/template/form_tag_helper_test.rb | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 33cf662375..a7b7f1f7f3 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -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] diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 39e508f433..d8e8f2005e 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -369,16 +369,16 @@ module ActionView # legend will become the fieldset's title (optional as per W3C). # # === Examples - # <% fieldset_tag do %> + # <% field_set_tag do %> #

<%= text_field_tag 'name' %>

# <% end %> # # =>

# - # <% fieldset_tag 'Your details' do %> + # <% field_set_tag 'Your details' do %> #

<%= text_field_tag 'name' %>

# <% end %> # # =>
Your details

- 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? diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index c2cdd7666c..c582c26c68 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -158,21 +158,21 @@ class FormTagHelperTest < Test::Unit::TestCase 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 = %(
Your detailsHello world!
) assert_dom_equal expected, _erbout _erbout = '' - fieldset_tag { _erbout.concat "Hello world!" } + field_set_tag { _erbout.concat "Hello world!" } expected = %(
Hello world!
) assert_dom_equal expected, _erbout _erbout = '' - fieldset_tag('') { _erbout.concat "Hello world!" } + field_set_tag('') { _erbout.concat "Hello world!" } expected = %(
Hello world!
) assert_dom_equal expected, _erbout -- cgit v1.2.3