How do I make an image link tag using haml in Rails?

Tony picture Tony · Jul 29, 2009 · Viewed 45.6k times · Source

I have something like this in application.html.haml:

#header
    = image_tag("header.jpg")

How do I make that link to www.google.com, for example?

Thanks

Answer

gdelfino picture gdelfino · Jul 29, 2009

I do it this way:

= link_to image_tag( 'header.jpg'), 'http://www.google.com'