Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript $(…).modal不是rails引导中的函数_Javascript_Jquery_Ruby On Rails_Twitter Bootstrap_Bootstrap Modal - Fatal编程技术网

Javascript $(…).modal不是rails引导中的函数

Javascript $(…).modal不是rails引导中的函数,javascript,jquery,ruby-on-rails,twitter-bootstrap,bootstrap-modal,Javascript,Jquery,Ruby On Rails,Twitter Bootstrap,Bootstrap Modal,我使用bootstrapmodals和rails5,我想在表单的submit按钮中隐藏模式。我使用模态作为视图 我已经尝试过使用data Disclose:“modal”,但数据没有在我的数据库中注册 我的应用程序结构如下: application.html.erb: 产品箱 如果(!window.jQuery)document.write(“>”); 从这里触发plomberie/new模式(参见第54行): 我是头球 测试 “模式”、:“数据切换”=>“模式”、:“数据目标”=>“#模式新

我使用bootstrapmodals和rails5,我想在表单的submit按钮中隐藏模式。我使用模态作为视图

我已经尝试过使用data Disclose:“modal”,但数据没有在我的数据库中注册

我的应用程序结构如下:

application.html.erb:
产品箱
如果(!window.jQuery)document.write(“>”);
从这里触发plomberie/new模式(参见第54行):
我是头球
测试
“模式”、:“数据切换”=>“模式”、:“数据目标”=>“#模式新服务”%>
rdv快车
(干预小组4小时)

rdv计划́ (普雷沃·乌特勒)

费尔默 视图/plomberie/_newform.html.erb模式的渲染: &时代; 显示模式内容的视图view.plomberie/new.js.erb:
$(“#modal_new_service”).html(“”;
您的代码都不是在代码段中运行的,我的观察结果是您已经包含了jQuery两次删除了其中一个还检查了

为我修复它的方法是将它添加到我的application.js文件中:

//= require twitter/bootstrap
与此相反:

//= require bootstrap

为了进一步说明这一点,我注意到当您导入jQuery偶数次时,它将无法工作。