Rails 3.1远程请求提交两次 [英] Rails 3.1 remote requests submitting twice

查看:91
本文介绍了Rails 3.1远程请求提交两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个Rails 3.1应用程序,该应用程序由100%的Ajax CRUD表单组成,用于输入用户和客户.我创建了两个单独的模型,控制器,视图等.每个模型的视图都包含用于创建编辑更新和销毁的jquery文件.问题是当我执行任何执行远程操作的操作时,它被称为两次.我可以在Firebug的控制台视图以及WEBrick输出的输出中确认这种情况.谁能协助追踪这里发生的事情?是什么原因会使Rails两次处理每个呼叫?

I developed a Rails 3.1 application that consists of a 100% Ajax CRUD forms to input users and customers. I created two separate models, controllers, views etc. The views for each model contain jquery files for create edit update and destroy. The problem is when I perform any operation that performs a remote operation, it is called twice. I can confirm this happening in console view in firebug as well as output in WEBrick output. Can anyone assist in tracking down what happened here? What would cause rails to process each call twice?

推荐答案

如果您已预编译资产并在开发模式下运行,则JavaScript将在页面上包含两次.

If you have precompiled the assets and running in development mode, then the JavaScripts will be included twice on the page.

如果处于开发模式,请从public/assets中删除所有内容.

Remove everything from public/assets if in development mode.

这篇关于Rails 3.1远程请求提交两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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