rails数据库操作执行两次 [英] rails database operations performed twice

查看:174
本文介绍了rails数据库操作执行两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这个问题上,我遵循了BearGrylls的回答: 1



它在heroku上运行良好,但在本地主机上,它在索引视图中的每个产品上都增加了两个。它是否依赖于Ubuntu 14.04(ruby 2.2.0p0)上的Rails 4.2的错误配置,或者我错过了什么? 解决方案

我发现:
$ b $ pre $ bundle exec rake资源:预编译
bundle exec rake资产:clean

code>

清理浏览器的缓存


I have followed the answer of BearGrylls on this question: 1

It works fine on heroku, but on localhost it increase by two on every product in index view. Does it depend by an errate configuration of my Rails 4.2 on Ubuntu 14.04 (ruby 2.2.0p0) or I missed something?

解决方案

I found this:

bundle exec rake assets:precompile
bundle exec rake assets:clean

clean your browser's cache

这篇关于rails数据库操作执行两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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