I have an HTML image tag, but how do I wrap it in a rails erb link_to element? <img src="/images/index_promo_long.png" alt="Promo Image" /> <- how do I link this with link_to --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
image <%= image_tag("/images/blah/blah", :alt => "Promo Image") %> link_to_image <%= link_to(image_tag("/images/blah/blah", :alt => "Promo Image"), stuff to build link) %> On 9/14/07, eggie5 <eggie5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I have an HTML image tag, but how do I wrap it in a rails erb link_to > element? > > <img src="/images/index_promo_long.png" alt="Promo Image" /> <- > how > do I link this with link_to > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Have you tried the following? I would also check out link_image_to(). link_to(image_tag("/images/index_promo_long.png", :alt => "Promo Image"), "http://www.example.com") or link_image_to("/images/index_promo_long.png", "http:// www.example.com", :alt => "Promo Image") On Sep 13, 11:46 pm, eggie5 <egg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have an HTML image tag, but how do I wrap it in a rails erb link_to > element? > > <img src="/images/index_promo_long.png" alt="Promo Image" /> <- how > do I link this with link_to--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 10/3/07, akv292 <akv292-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Have you tried the following? I would also check out link_image_to(). > > link_to(image_tag("/images/index_promo_long.png", :alt => "Promo > Image"), "http://www.example.com") > > or > > link_image_to("/images/index_promo_long.png", "http:// > www.example.com", :alt => "Promo Image")The first form is correct. The second form is deprecated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---