link_to :confirm displays popup twice

后端 未结 16 1851
感情败类
感情败类 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:36

    Great answers here,

    But if you did everything and still get those double popups, and if you are running in development mode, check if you have public/assets loaded with compiled assets.

    Deleting public/assets/* solves the issue.

    0 讨论(0)
  • 2020-11-30 03:41

    In my case (Rails 3.2.13), I had to delete rails.js to fix the same problem.

    I did not explicitly reference rails.js, nor did changing config.assets.debug help.

    0 讨论(0)
  • 2020-11-30 03:43

    just remove the turbolinks, that worked for me in rails4

    0 讨论(0)
  • 2020-11-30 03:44

    So for me it was because i had defined data-remote instead of just remote.

    IE

    data: { remote: true, ... }

    instead of

    remote: true, data: { ... }

    hope that helps.

    0 讨论(0)
提交回复
热议问题