you can''t use the ''size'' option with the tag helper,
only with the
image_tag helper. the "size" option will get translated to
height/width with image_tag
with the tag helper, you have to give all the correct attributes, so
use height/width options.
img_options["height"], img_options["width"] =
img_size.split("x")
On 5/2/07, sanjay
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> hi guys,
> I have show_image problem. I have the following code in
> application_helper.rb in my rails project
>
> def show_image(src,img_size)
> img_options = { "src" => src.include?("/") ? src :
"/images/#{src}" }
> img_options["src"] = img_options["src"] +
".gif" unless
> img_options["src"].include?(".")
> img_options["border"] = "0"
> img_options["size"] = img_size
> tag("img", img_options)
> end
> end
>
> in my list.rhtml page I have the following code:
>
> <%= show_image("WORK2R-2_02.gif","16x16") %>
>
> But the second parameter is not working for me.
>
> Is the problem in syntax?
>
> plz make me clear.
>
> sanjay
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---