[英]Rails image link_to not working
這很好
<%= link_to "up.png", voteup_path(post_id: post.id, topic_id: post.topic_id), class: "xta" %>
但不是這個
<%= link_to image_tag("up.png"), voteup_path(post_id: post.id, topic_id: post.topic_id), class: "xta" %>
請告訴我我如何使它工作。
試試這個,將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.