【发布时间】:2012-12-08 12:03:00
【问题描述】:
我想在 Rails 中的链接上添加确认弹出窗口。由于浏览器的默认 css confirm: 方法无法更改,因此我决定使用 bootbox。 (http://bootboxjs.com/)
假设我的 rails 应用程序中有以下链接
= link_to "asd", root_path(), id: "test"
以下javascript代码打开一个弹出窗口,结果设置正确,如果用户批准确认,我现在需要执行链接访问。
$("#test").click(function(e) {
e.preventDefault();
bootbox.confirm("Are you sure?", function(result) {
if (result) {
// ???
} else {
return false;
}
});
});
【问题讨论】:
标签: javascript ruby-on-rails twitter-bootstrap