Turbolinks.enableTransitionCache is not a function

Viewed 677

I'm trying to do the following in a rails 5.1 app with turbolinks 5:

$(document).on 'turbolinks:load', ->
  REFRESH_INTERVAL_IN_MILLIS = 5000
  if $('.f-pending-message').length > 0
    setTimeout (->
      Turbolinks.enableTransitionCache(true)
      Turbolinks.visit location.toString()
      Turbolinks.enableTransitionCache(false)
      return
    ), REFRESH_INTERVAL_IN_MILLIS

But I keep on getting:

TypeError: Turbolinks.enableTransitionCache is not a function. (In 'Turbolinks.enableTransitionCache()', 'Turbolinks.enableTransitionCache' is undefined)

What am I doing wrong?

1 Answers
Related