简体   繁体   English

rails 3.2中的link_to方法问题

[英]Issue with link_to method in rails 3.2

We are upgrading rails from 2.3.5 to 3.2.1. 我们正在将rails从2.3.5升级到3.2.1。 While upgrading we are getting issue with link_to method.We have the following code snippet. 升级时我们遇到了link_to方法的问题。我们有以下代码片段。

link_to( name, path_options, html_options, *params ) link_to(name,path_options,html_options,* params)

Here name is: <span class='bmark_link_tag'><img alt="Post this blog to Stumbleupon" src="/images/png/stumble.png" />&nbsp;Stumbleupon</span> 这里的名字是: <span class='bmark_link_tag'><img alt="Post this blog to Stumbleupon" src="/images/png/stumble.png" />&nbsp;Stumbleupon</span>

But while rendering it is directly displaying the above name value instead of displaying image in UI. 但是渲染时直接显示上面的名称值而不是在UI中显示图像。

Could you please help us on this ASAP. 能尽快帮助我们吗?

你可以在link_to中使用image_tag,

<%= link_to image_tag("images/png/stumble.png", :alt=>"Post this blog to Stumbleupon", :class=>"bmark_link_tag")+"Stumbleupon", your_path %>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM