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") %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.