1

一个按钮:disable_with工作正常。

<%= link_to change_status_path(post), :class => "btn btn-large btn btn-danger", :disable_with => "<i class=\"icon-eye-close\"></i> #{t('.unpublish')}",  :confirm => t('.sure_unpublish'), :method => :put do %>
  <i class="icon-eye-close"></i>
  <%= t('.unpublish') %>
<% end %>

但是,如果我添加其他按钮:

<%= link_to change_status_path(post), :class => "btn btn-large btn btn-danger", :disable_with => "<i class=\"icon-eye-close\"></i> #{t('.unpublish')}",  :confirm => t('.sure_unpublish'), :method => :put do %>
  <i class="icon-eye-close"></i>
  <%= t('.unpublish') %>
<% end %>

<%= link_to change_status_path(cv), :class => "btn btn-large btn btn-success", :disable_with => "<i class=\"icon-eye-open\"></i> #{t('.publish')}", :confirm => t('.sure_publish'), :method => :put do %>
  <i class="icon-eye-open"></i>
  <%= t('.publish') %>
<% end %>

:disable_with 不适用于多个按钮。

我究竟做错了什么?

4

0 回答 0