作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有这段代码,我想包含字形图标,但下面的代码不起作用。如果我删除 subcomment_link
类,它将起作用,但我确实需要为 jquery
包含它。指定类的远程 link_to
的正确语法是什么?
<%= link_to new_subcomment_path(:response_id => response.id), class: "subcomment_link", id: "reply_new_subcomment#{response.id}", remote: true do %>
<i class="glyphicon glyphicon-pencil"></i>  Edit your profile
<% end %>
最佳答案
尝试将其更改为:
<%= link_to new_subcomment_path(:response_id => response.id), {remote: true}, {class: "subcomment_link", id: "reply_new_subcomment#{response.id}"} do %>
通常标签选项出现在 html 选项之前。
关于ruby-on-rails - 如何在 link_to 远程中包含类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29733907/
我是一名优秀的程序员,十分优秀!