From 79b5706eda037517b0963896492998d2c4e1f9d6 Mon Sep 17 00:00:00 2001 From: Donald Ball Date: Sun, 23 Nov 2008 22:54:53 -0600 Subject: [PATCH] relying on ActionView's helper methods to construct the HTML --- lib/zoomifier_helper.rb | 4 +++- spec/zoomifier_helper_spec.rb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/zoomifier_helper.rb b/lib/zoomifier_helper.rb index e6164a5..acdeefd 100644 --- a/lib/zoomifier_helper.rb +++ b/lib/zoomifier_helper.rb @@ -2,7 +2,9 @@ module Zoomifier module ViewHelpers def zoomify_image_tag(source, options = {}) raise ArgumentError unless options[:id] - "
\"\"/
" + content_tag :div, { :id => options[:id] } do + image_tag source, options.merge({ :id => nil }) + end end end end diff --git a/spec/zoomifier_helper_spec.rb b/spec/zoomifier_helper_spec.rb index 2f3767a..9df9bd6 100644 --- a/spec/zoomifier_helper_spec.rb +++ b/spec/zoomifier_helper_spec.rb @@ -16,7 +16,7 @@ describe Zoomifier::ViewHelpers do end it "should generate the zoomify markup" do - @view.zoomify_image_tag('foo.jpg', { :id => 'foo' }).should == - '
' + @view.zoomify_image_tag('foo.jpg', { :id => 'foo', :alt => 'Foo Bar' }).should == + '
Foo Bar
' end end