Why does a rails app on heroku serve assets via all.css and locally via individual files

后端 未结 3 1925
无人及你
无人及你 2021-01-02 00:15

I\'m a rails newbie, I\'ve been trying to figure out what is going on with the stylesheets_link_tag on heroku.

If I use

= stylesheet_link_tag \"style         


        
3条回答
  •  时光取名叫无心
    2021-01-02 00:52

    Setting :cache => true causes my requests to fail outright.

    My solution for the short term is to add the following to my config/environments/prodcution.rb

    config.serve_static_assets = true
    

    I'm slightly less worried about the performance being behind Cloudflare. Finding a way to serve my css and js files concatenated is on my to-do list.

提交回复
热议问题