[英]Rails image link_to not working
This is working fine 这很好
<%= link_to "up.png", voteup_path(post_id: post.id, topic_id: post.topic_id), class: "xta" %>
but not this 但不是这个
<%= link_to image_tag("up.png"), voteup_path(post_id: post.id, topic_id: post.topic_id), class: "xta" %>
Please tell me how i can make it work. 请告诉我我如何使它工作。
试试这个,将image_tag
和class传递给link_to
标签
<%=link_to( image_tag("up.png"),voteup_path(post_id: post.id, topic_id: post.topic_id), class: "xta") %>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.