Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Rails图像链接\u不工作_Html_Css_Ruby On Rails - Fatal编程技术网

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谢谢它的工作:)。“请回答,这样我就可以正确地标记它,很高兴它对您有效,”作为回答补充道