Removed the default border on link_image_to (it broke xhtml strict) -- can be specified with :border => 0 #517 [?/caleb]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@836 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-03-06 12:02:17 +00:00
parent fe6d929bf0
commit eb5ca2ea5f
3 changed files with 11 additions and 11 deletions

@ -1,5 +1,7 @@
*SVN* *SVN*
* Removed the default border on link_image_to (it broke xhtml strict) -- can be specified with :border => 0 #517 [?/caleb]
* Fixed that form helpers would treat string and symbol keys differently in html_options (and possibly create duplicate entries) #112 [bitsweat] * Fixed that form helpers would treat string and symbol keys differently in html_options (and possibly create duplicate entries) #112 [bitsweat]
* Fixed that broken pipe errors (clients disconnecting in mid-request) could bring down a fcgi process * Fixed that broken pipe errors (clients disconnecting in mid-request) could bring down a fcgi process

@ -39,7 +39,7 @@ def link_to(name, options = {}, html_options = nil, *parameters_for_method_refer
# #
# * <tt>:alt</tt> - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension) # * <tt>:alt</tt> - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension)
# * <tt>:size</tt> - Supplied as "XxY", so "30x45" becomes width="30" and height="45" # * <tt>:size</tt> - Supplied as "XxY", so "30x45" becomes width="30" and height="45"
# * <tt>:border</tt> - Is set to 0 by default # * <tt>:border</tt> - Draws a border around the link
# * <tt>:align</tt> - Sets the alignment, no special features # * <tt>:align</tt> - Sets the alignment, no special features
# #
# The +src+ can be supplied as a... # The +src+ can be supplied as a...
@ -70,8 +70,6 @@ def link_image_to(src, options = {}, html_options = {}, *parameters_for_method_r
if html_options["border"] if html_options["border"]
image_options["border"] = html_options["border"] image_options["border"] = html_options["border"]
html_options.delete "border" html_options.delete "border"
else
image_options["border"] = "0"
end end
if html_options["align"] if html_options["align"]

@ -29,21 +29,21 @@ def test_link_tag_with_javascript_confirm
) )
end end
def test_link_to_image def test_link_image_to
assert_equal( assert_equal(
"<a href=\"http://www.world.com\"><img alt=\"Rss\" border=\"0\" height=\"45\" src=\"/images/rss.png\" width=\"30\" /></a>", "<a href=\"http://www.world.com\"><img alt=\"Rss\" border=\"0\" height=\"45\" src=\"/images/rss.png\" width=\"30\" /></a>",
link_to_image("rss", "http://www.world.com", "size" => "30x45") link_image_to("rss", "http://www.world.com", "size" => "30x45", "border" => "0")
) )
assert_equal( assert_equal(
"<a class=\"admin\" href=\"http://www.world.com\"><img alt=\"Feed\" border=\"0\" height=\"45\" src=\"/images/rss.gif\" width=\"30\" /></a>", "<a class=\"admin\" href=\"http://www.world.com\"><img alt=\"Feed\" height=\"45\" src=\"/images/rss.gif\" width=\"30\" /></a>",
link_to_image("rss.gif", "http://www.world.com", "size" => "30x45", "alt" => "Feed", "class" => "admin") link_image_to("rss.gif", "http://www.world.com", "size" => "30x45", "alt" => "Feed", "class" => "admin")
) )
assert_equal link_to_image("rss", "http://www.world.com", "size" => "30x45"), assert_equal link_image_to("rss", "http://www.world.com", "size" => "30x45"),
link_to_image("rss", "http://www.world.com", :size => "30x45") link_image_to("rss", "http://www.world.com", :size => "30x45")
assert_equal link_to_image("rss.gif", "http://www.world.com", "size" => "30x45", "alt" => "Feed", "class" => "admin"), assert_equal link_image_to("rss.gif", "http://www.world.com", "size" => "30x45", "alt" => "Feed", "class" => "admin"),
link_to_image("rss.gif", "http://www.world.com", :size => "30x45", :alt => "Feed", :class => "admin") link_image_to("rss.gif", "http://www.world.com", :size => "30x45", :alt => "Feed", :class => "admin")
end end
def test_link_unless_current def test_link_unless_current