Fixed TagHelper such that :name and 'name' keys in the options doesn't result in two attributes #1455 [take_tk]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-06-16 05:04:17 +00:00
parent 7bb486055e
commit cc6c48f0a8
3 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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"),