在 2021 年或 2022 年创建的新 Rails 7 应用程序,当我单击带有 的表单时data-turbo-confirm
,不会显示警报消息。
<%= form_with url: root_path(), data: {'turbo-confirm': "Are you sure you want to submit this form?"},
method: :delete do |f| %>
<%= f.submit "Delete".html_safe, class: "delete-apple-button btn btn-primary btn-sm" %>
<% end %>
<br />
<%= turbo_frame_tag "apples-list" do %>
nothing has happened yet
<% end %>
页面加载到:
单击删除时,不会显示任何警报:
预期结果: • 确认按钮操作的警报消息
实际结果: • 不显示警报