Forum: Ruby on Rails an image that is a clickable link?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eea3feaacbe44706164289d068d94828?d=identicon&s=25 Peter Michaux (Guest)
on 2006-01-23 22:49
(Received via mailing list)
Hi,

How do I make an image that is a clickable link the rails way? Is
there a view helper for this?

Thanks,
Peter
413faf211358af7cae68c1f2137de0f8?d=identicon&s=25 Mel Riffe (Guest)
on 2006-01-23 22:58
(Received via mailing list)
Hey Peter,

I just learned how to do that! Try this:
http://api.rubyonrails.com/classes/ActionView/Help...

HTH

Mel
D90ef6808433e63203e15a5c2dadb0bb?d=identicon&s=25 Ben Reubenstien (Guest)
on 2006-01-23 23:01
(Received via mailing list)
Put an image_tag inside a link_to tag.

e.g. ~ <%= link_to(image_tag("myimage"), {:controller => "mycontroller",
:action => "myaction"}) %>
E4b00857b845342264923e3e6c504c14?d=identicon&s=25 Bama Test (Guest)
on 2006-01-23 23:04
(Received via mailing list)
>From the API documentation

Combine the link_to and image_tag yourself  like:
link_to(image_tag("rss", :size => "30x45", :border => 0),
"http://www.example.com")(or you can go to this link to go directly to
the specific page i referenced
http://api.rubyonrails.com/classes/ActionView/Help...

----- Original Message ----
From: Peter Michaux <petermichaux@gmail.com>
To: rails@lists.rubyonrails.org
Sent: Monday, January 23, 2006 3:46:23 PM
Subject: [Rails] an image that is a clickable link?

Hi,

How do I make an image that is a clickable link the rails way? Is
there a view helper for this?

Thanks,
Peter
Eea3feaacbe44706164289d068d94828?d=identicon&s=25 Peter Michaux (Guest)
on 2006-01-23 23:20
(Received via mailing list)
Thanks all.
This topic is locked and can not be replied to.