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

僤鯓⒐⒋嵵緔 提交于 2019-11-28 21:20:54

问题


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


回答1:


I do it this way:

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


来源:https://stackoverflow.com/questions/1202654/how-do-i-make-an-image-link-tag-using-haml-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!