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:
parent
072116fffe
commit
5aa85f233e
1 changed files with 17 additions and 18 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue