0

how can I display and image and make it linkable?

example:

=image_tag 'pdf_doc.png' href: => p.pdf.to_s target: "_blank"
Zombo
  • 1
  • 62
  • 391
  • 407
Shoosty
  • 29
  • 5

1 Answers1

1

Just add the "(" to the image tag.

= link_to image_tag ("image.png"), {:action => :p.pdf}

Chaibi Alaa
  • 1,346
  • 4
  • 25
  • 54
  • = link_to image_tag('pdf_doc.png'),(:action => :p.pdf.to_s), (target: "_blank") – Shoosty Sep 15 '15 at 03:44
  • = link_to image_tag('pdf_doc.png'),{:href => p.pdf.to_s, target: "_blank"} – Shoosty Sep 15 '15 at 03:54
  • http://lvh.me:3000/portfolio?href=https%3A%2F%2Fshoosty3b-dev.s3.amazonaws.com%2Fuploads%2Fphoto%2Fpdf%2F15%2F_steves_brochures_Part11.pdf&target=_blank – Shoosty Sep 15 '15 at 03:54
  • it only partially works. I can bring up the image, I can click on it but its is taking me to lvh.me:3000/portfolio?href=https .... How do I avoide the first part of the link? – Shoosty Sep 15 '15 at 04:25