Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Image "link_to", how to do that?
3 Posts
Image "link_to", how to do that?

Hi, i've working with rails for a litle time, it's kind a "noob" question but i need your help people.

I need to do a link with a image, something like a "link_to", when a click on the imagem i want to be redirect for some action.

Someone knows how to do that?

Thanks :)

Here is an example of link_to with an image I use for linking to thumbnails with the Paperclip plugin. thumb.id %> Just to a link_to as normal, but for the content, pass in a image_tag link_to image_tag('path/to/image'), '/path/to/route' or link_to(image_tag('path/to/image'), @image) I am sure there are other ways but this should do what you want to.

Hey, very thanks, works perfect for me =)

3 Posts
Login to add your message