Commit e520c0fb8140399900ba610e9059d9ad81898cbc
1 parent
8f633a81
Exists in
master
and in
21 other branches
Fix caching theme stylesheet with asset pipeline
If stylesheet_link_tag gets's an absolute path starting with /assets, it won't append a hash of the file contents to the URL, so if you update a theme you won't get a new URL and varnish will cache the old stylesheet for a month or so.
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/helpers/layout_helper.rb
| @@ -86,7 +86,7 @@ module LayoutHelper | @@ -86,7 +86,7 @@ module LayoutHelper | ||
| 86 | end | 86 | end |
| 87 | 87 | ||
| 88 | def theme_stylesheet_path | 88 | def theme_stylesheet_path |
| 89 | - "/assets#{theme_path}/style.css" | 89 | + "#{theme_path}/style.css".gsub(%r{^/}, '') |
| 90 | end | 90 | end |
| 91 | 91 | ||
| 92 | def layout_template | 92 | def layout_template |