diff options
author | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-24 12:10:27 +0000 |
---|---|---|
committer | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-24 12:10:27 +0000 |
commit | 1edaf1ad2cbffa98c375724c3aedbb2d005d6f25 (patch) | |
tree | 2aab98dfee948dd3ef2b33560bd82beebcf20a36 /lib/cgi | |
parent | 888cbd4fe46d1fa6893b7edde9d0ae5adf3f4dd1 (diff) | |
download | ruby-1edaf1ad2cbffa98c375724c3aedbb2d005d6f25.tar.gz ruby-1edaf1ad2cbffa98c375724c3aedbb2d005d6f25.tar.xz ruby-1edaf1ad2cbffa98c375724c3aedbb2d005d6f25.zip |
* lib/cgi/html.rb: allow symbolized key.
* test/cgi/test_cgi_tag_helper.rb: add a test.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi')
-rw-r--r-- | lib/cgi/html.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb index 74aa730be..62f1fc189 100644 --- a/lib/cgi/html.rb +++ b/lib/cgi/html.rb @@ -27,11 +27,11 @@ class CGI attributes={attributes=>nil} if attributes.kind_of?(String) "<#{element.upcase}" + attributes.collect{|name, value| next unless value - " " + CGI::escapeHTML(name) + + " " + CGI::escapeHTML(name.to_s) + if true == value "" else - '="' + CGI::escapeHTML(value) + '"' + '="' + CGI::escapeHTML(value.to_s) + '"' end }.join + ">" END |