【问题标题】:RAILS, button - ugly strip导轨,按钮 - 丑陋的条
【发布时间】:2017-05-11 09:19:53
【问题描述】:

将鼠标移到这段代码上:

<%= link_to pozycja, method: :delete, data: { confirm: 'Sure?' } do %>
  <button type="button" class="alarm">usuń</button>
<% end %>

显示比按钮更宽的丑陋条带。我想让这项工作“正常”。

按钮本身,没有link_to

<button type="button" class="alarm">usuń</button>

按预期工作。

【问题讨论】:

    标签: html css ruby-on-rails erb


    【解决方案1】:

    如果我没听错的话。由于link_to,您的文本下方会出现一条条带。这是因为link_to 生成了一个锚标记&lt;a&gt;,因此您遇到了问题。为了删除该条带,您可以使用button_to,您可以轻松实现您想要的。

    <%= button_to pozycja, class: 'alarm', method: :delete, data: { confirm: 'Sure?' } do  %>
        usuń
    <% end %>
    

    希望对你有帮助。

    【讨论】:

    • 我认为你的解释是对的,但你的解决方案不起作用。它生成两个按钮。
    • 检查更新。回答你的问题时很着急,所以弄错了。
    猜你喜欢
    • 1970-01-01
    • 2016-04-13
    • 1970-01-01
    • 2015-06-28
    • 2012-03-08
    • 1970-01-01
    • 1970-01-01
    • 2019-09-30
    • 1970-01-01
    相关资源
    最近更新 更多