From eb5ca2ea5ff55e2f6a49580afab5e0ddd0b2bf11 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 6 Mar 2005 12:02:17 +0000 Subject: [PATCH] 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 --- actionpack/CHANGELOG | 2 ++ actionpack/lib/action_view/helpers/url_helper.rb | 4 +--- actionpack/test/template/url_helper_test.rb | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 18ea6b9b4c..dca6e65f46 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *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 broken pipe errors (clients disconnecting in mid-request) could bring down a fcgi process diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 901374d877..6c5e338e54 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -39,7 +39,7 @@ module ActionView # # * :alt - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension) # * :size - Supplied as "XxY", so "30x45" becomes width="30" and height="45" - # * :border - Is set to 0 by default + # * :border - Draws a border around the link # * :align - Sets the alignment, no special features # # The +src+ can be supplied as a... @@ -70,8 +70,6 @@ module ActionView if html_options["border"] image_options["border"] = html_options["border"] html_options.delete "border" - else - image_options["border"] = "0" end if html_options["align"] diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 379db0b9b7..47241bd09f 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -29,21 +29,21 @@ class UrlHelperTest < Test::Unit::TestCase ) end - def test_link_to_image + def test_link_image_to assert_equal( "\"Rss\"", - link_to_image("rss", "http://www.world.com", "size" => "30x45") + link_image_to("rss", "http://www.world.com", "size" => "30x45", "border" => "0") ) assert_equal( - "\"Feed\"", - link_to_image("rss.gif", "http://www.world.com", "size" => "30x45", "alt" => "Feed", "class" => "admin") + "\"Feed\"", + 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"), - link_to_image("rss", "http://www.world.com", :size => "30x45") - assert_equal link_to_image("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") + assert_equal link_image_to("rss", "http://www.world.com", "size" => "30x45"), + link_image_to("rss", "http://www.world.com", :size => "30x45") + assert_equal link_image_to("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 def test_link_unless_current