ruby on rails:为什么javascript / coffeescript资产会丢失?

时间:2013-01-26 14:39:58

标签: ruby-on-rails asset-pipeline

我在查看places控制器的表单页面时在文件places.js.coffee内部工作。出于某种原因,我对CofeeScript文件所做的任何更改都不会反映在浏览器中。我尝试重新启动服务器,运行rake assets:clean并手动删除内容/tmp/cache/assets/,但没有任何效果。

我查看了终端中rails服务器的输出,我注意到一些奇怪的事情:

Started GET "/assets/offers.js?body=1" for 127.0.0.1 at 2013-01-26 09:35:56 -0500
Served asset /offers.js - 304 Not Modified (0ms)


Started GET "/assets/partners.js?body=1" for 127.0.0.1 at 2013-01-26 09:35:56 -0500
Served asset /partners.js - 304 Not Modified (0ms)


Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-01-26 09:35:56 -0500
Served asset /application.js - 304 Not Modified (6ms)

places.js无处可寻!为什么是这样?我该如何解决?

1 个答案:

答案 0 :(得分:0)

确保您的app/assets/javascripts/application.js文件包含以下行:

//= require places