Rails 3.1 Assets - Strange Serving in Development

后端 未结 5 1612
离开以前
离开以前 2020-12-02 09:04

I\'ve got a problem with Rails 3.1 assets pipeline. Assets are included twice in development:



        
5条回答
  •  半阙折子戏
    2020-12-02 10:08

    Try adding the following to development.rb:

    config.serve_static_assets = false
    

    ...and then clearing your browser cache (update based on comments)

    The static assets refer to precompiled assets in public/assets, which is where rake assets:precompile puts them.

    What's happening is that anything that exists in public/assets will override anything in app/assets if you are serving them. So public/assets/application.js is being loaded when the js tag is intending to identifiy app/assets/application.js.

提交回复
热议问题