link_to :confirm displays popup twice

后端 未结 16 1933
感情败类
感情败类 2020-11-30 02:38

This tag with rails 3

<%= link_to \'Destroy\', item, :method => :delete,:confirm=>\'Are you sure?\' %>

produces this html

16条回答
  •  误落风尘
    2020-11-30 03:19

    I copy this solution from another post, but this is what worked for me (rails 5)

    "remove jquery_ujs from your application.js as rails_ujs is enough for later rails version."

    I had included: //= require jquery //= require jquery-ujs //= require rails-ujs

    and after deleting it, all works fine. Solution from: Why am I getting a JQuery alert twice in Rails?

提交回复
热议问题