link_to :confirm 显示两次弹出窗口 [英] link_to :confirm displays popup twice

查看:33
本文介绍了link_to :confirm 显示两次弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个带有 rails 3 的标签

This tag with rails 3

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

产生这个html

<a href="/news/3" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Destroy</a>

条目被删除,问题是弹窗出现了两次.

The entry is deleted, the problem is that the popup appears twice.

这可能是什么原因造成的?

What could be causing this?

推荐答案

听起来 rails.js 中的确认处理程序 Javascript 被附加了两次.

It sounds like the confirmation handler Javascript in rails.js is being attached twice.

您是否会通过复制 javascript_include_tag 帮助程序意外地包含两个 rails.js 副本?

Could you be accidentally including two copies of rails.js via duplication of a javascript_include_tag helper?

这篇关于link_to :confirm 显示两次弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆