有没有更好的方法来执行此链接
这是我的 link_to
<%= link_to "<input type='button', value='Somewhere', class ='big'/>".html_safe, selection_path %>
但在 IE 中不起作用...它的渲染
<a href="/selection"><input class="big" value="Somewhere" type="button" ,=""></a>
因此链接中存在损坏....有关如何修复的任何想法
Here is my link_to
<%= link_to "<input type='button', value='Somewhere', class ='big'/>".html_safe, selection_path %>
but in IE is not working ...its rendering
<a href="/selection"><input class="big" value="Somewhere" type="button" ,=""></a>
so there is a breakage in the link ....any ideas on how to fix
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 button_to 而不是将按钮放在链接到:
Use button_to instead of putting a button inside of a link_to:
link_to
用于链接,button_to
用于按钮。最好不要尝试将两者混合在一起。这里,您在link_to
帮助器内部有一个button
类型的input
。各种混乱不断发生。我想这可能会起作用,但这似乎是一种困难的方法。尝试使用button_to
代替link_to
is for links,button_to
is for buttons. It's probably best to not try to mix the two. Here you've got aninput
of typebutton
inside of alink_to
helper. All kinds of confusion going on. I suppose it might work, but it seems like the hard way of doing it. Trying using abutton_to
instead您不应该在属性之间放置逗号。
You're not supposed to put commas between properties.