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 On 1/23/06, Peter Michaux <petermichaux@gmail.com> wrote:> > Hi, > > How do I make an image that is a clickable link the rails way? Is > there a view helper for this? > > Thanks, > Peter > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060123/c6bc4bee/attachment.html
Put an image_tag inside a link_to tag.
e.g. ~ <%= link_to(image_tag("myimage"), {:controller =>
"mycontroller",
:action => "myaction"}) %>
On 1/23/06, Peter Michaux <petermichaux@gmail.com>
wrote:>
> Hi,
>
> How do I make an image that is a clickable link the rails way? Is
> there a view helper for this?
>
> Thanks,
> Peter
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Ben Reubenstein
http://www.benr75.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060123/6f47194c/attachment.html
>From the API documentationCombine 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 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 _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060123/221e9d2d/attachment.html