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

Hey Peter,

I just learned how to do that! Try this:
http://api.rubyonrails.com/classes/ActionView/Helpers/UrlHelper.html#M000334

HTH

Mel

Put an image_tag inside a link_to tag.

e.g. ~ <%= link_to(image_tag(“myimage”), {:controller => “mycontroller”,
:action => “myaction”}) %>

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/Helpers/UrlHelper.html#M000334

----- Original Message ----
From: Peter M. [email protected]
To: [email protected]
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

Thanks all.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs