将link_to转换为图像

时间:2017-05-03 04:33:05

标签: ruby-on-rails ruby

我想将“赞”(upvote)链接更改为图像。现在我有这个,它不会显示:

<td><%= link_to image_tag("thumb.png"), like_review_path(review), method: :post%>[<%=review.get_upvotes.size%>]</td>

1 个答案:

答案 0 :(得分:0)

试试这个,将image_tag和class传递给link_to标记

<%=link_to( image_tag("thumb.png"), like_review_path(review), method: :post) %>

相关问题