Hi All I would like to display images including the alt tag So far this seems to come very close <%= link_to( image_tag("myimg.png", { :border => 0, :alt => "bla bla" }), :action => "config" ) %> I see the image and no border (which is what I want :), but no alt!! Any suggestions why ? Thnx a lot LuCa ps Maybe important, I''m using firefox! -- 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 -~----------~----~----~----~------~----~------~--~---
According to the RDocs, it looks right to me, so I''ll defer that part to a more experienced user. But I do want to ask why you are using curly braces between border and alt ?? Is there a benefit there that I''m unaware of? Matt On Fri, 2006-12-22 at 22:04 +0100, Luca Scaljery wrote:> Hi All > > I would like to display images including the alt tag > > So far this seems to come very close > > <%= link_to( image_tag("myimg.png", { :border => 0, :alt => "bla bla" > }), :action => "config" ) %> > > I see the image and no border (which is what I want :), but no alt!! > > Any suggestions why ? > > Thnx a lot > LuCa > > ps Maybe important, I''m using firefox! >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
The curly braces is something I found on the internet. When I remove them I get the same result ( no alt ) LuCa -- 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 -~----------~----~----~----~------~----~------~--~---
> So far this seems to come very close > > <%= link_to( image_tag("myimg.png", { :border => 0, :alt => "bla bla" > }), :action => "config" ) %> > > I see the image and no border (which is what I want :), but no alt!!Works perfectly for me. What do you mean by saying you see no alt? Did you look for it in generated HTML, or do you expect it to show up like little yellow popup(tool-tip) when hovering mouse cursor over image? In latter case only IE will show alt attribute as tool-tip and IE is wrong. If you still want this tool-tip you should use title attribute, not alt. If tool-tip is not that you want, then check your code and generated HTML. With the code you''ve provided I get: <a href="/test/config"><img alt="bla bla" border="0" src="/images/myimg.png" /></a> - just how it is supposed to work. Regards, Rimantas -- http://rimantas.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 -~----------~----~----~----~------~----~------~--~---
yep, :title attribute is what I need!! Thnx a lot LuCa -- 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 -~----------~----~----~----~------~----~------~--~---