美文网首页
使用ajax提交导致附件上传附件报错的解决方法

使用ajax提交导致附件上传附件报错的解决方法

作者: 33d8e4ec2cc9 | 来源:发表于2015-12-13 14:41 被阅读36次

先安装一个gem

gem 'remotipart', '~> 1.2'
bundle install

然后进入application.js,引入
//= require jquery.remotipart

最后在你的表单页面写一段js
$(form).bind("ajax:success", function(){
  if ( $(this).data('remotipartSubmitted') )
});

搞定!

相关文章

网友评论

      本文标题:使用ajax提交导致附件上传附件报错的解决方法

      本文链接:https://www.haomeiwen.com/subject/ncxuhttx.html