【发布时间】:2019-07-15 11:36:50
【问题描述】:
我已经使用 Rails link_to 和 CSS 类没有任何问题,但我认为我使用正确但它根本不显示
因为我正在尝试将 CSS 创建为 Accept(绿色背景色)和 Decline(红色背景色)
作为简单的文本
<p class="text-center"><%= reservation.status %></p>
<div class="form-inline">
<% if reservation.Waiting? %>
<%= link_to approve_reservation_path(reservation), class:"btn-declined", method: :post do %> <% end %>
<%= link_to decline_reservation_path(reservation), class:"btn-approved", method: :post do %> <% end %>
<% end %>
</div>
因为使用了不同的方式,但没有 CSS 只显示文本
控制台日志显示没有用于接受和拒绝的 CSS
CSS 代码
什么是在其上显示 CSS 的替代方法
【问题讨论】:
-
<%= link_to "Approve", approve_reservation_path(reservation), class:"btn-declined", method: :post %>不加do
标签: css ruby-on-rails ruby-on-rails-5