Html Rails图像链接\u不工作
这很好用Html Rails图像链接\u不工作,html,css,ruby-on-rails,Html,Css,Ruby On Rails,这很好用 <%= 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" %> 请告诉我如何使它工作。试试这个,将图
<%= 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" %>
请告诉我如何使它工作。试试这个,将
图像\u标签传递给并将类传递给链接到标签
<%=link_to( image_tag("up.png"),voteup_path(post_id: post.id, topic_id: post.topic_id), class: "xta") %>
尝试此操作,将图像\u标记传递给并将类链接到标记
<%=link_to( image_tag("up.png"),voteup_path(post_id: post.id, topic_id: post.topic_id), class: "xta") %>
试试这个
@Sontya谢谢它的工作:)。请回答,以便我能将其标记为正确,很高兴它为您工作,作为回答添加尝试此
@Sontya谢谢它的工作:)。“请回答,这样我就可以正确地标记它,很高兴它对您有效,”作为回答补充道