diff options
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/tag_helper.rb | 3 | ||||
-rw-r--r-- | actionpack/test/template/tag_helper_test.rb | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 75e62096ab..5c61cf49b8 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fixed TagHelper such that :name and 'name' keys in the options doesn't result in two attributes #1455 [take_tk] + * Ensure that helpers are only available to the controllers where they are defined and their subclasses. #1394 [kdole@tamu.edu] * render("foo/bar") works with a layout again diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index 895a44eab5..1753ef9acf 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -25,8 +25,7 @@ module ActionView private def tag_options(options) unless options.empty? - options.symbolize_keys - " " + options.map { |key, value| + " " + options.symbolize_keys.map { |key, value| %(#{key}="#{html_escape(value.to_s)}") }.sort.join(" ") end diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb index f5394bd483..a3acdbcfd3 100644 --- a/actionpack/test/template/tag_helper_test.rb +++ b/actionpack/test/template/tag_helper_test.rb @@ -12,6 +12,10 @@ class TagHelperTest < Test::Unit::TestCase assert_equal tag("p", "class" => "show"), tag("p", :class => "show") end + def test_tag_options + assert_equal "<p class=\"elsewhere\" />", tag("p", "class" => "show", :class => "elsewhere") + end + def test_content_tag assert_equal "<a href=\"create\">Create</a>", content_tag("a", "Create", "href" => "create") assert_equal content_tag("a", "Create", "href" => "create"), |