Can't cache javascript that is supposed to run

From the CaptureHelper docu¹
```
WARNING: content_for is ignored in caches. So you shouldn't use it for elements that will be fragment cached.
```

¹ https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for
This commit is contained in:
Henne Vogelsang 2019-02-16 00:31:15 +01:00
parent 072116fffe
commit 5aa85f233e

View file

@ -64,8 +64,7 @@
= render 'social_media', contact: @conference.contact = render 'social_media', contact: @conference.contact
= render 'footer' = render 'footer'
- cache [@conference.color, '#splash#inlinejs'] do - content_for :script_head do
- content_for :script_head do
:javascript :javascript
var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic(); var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic();
var triangle_colors = triangle_tcs.map(function(t) { var triangle_colors = triangle_tcs.map(function(t) {