我正在尝试在带有 turbolinks 5 的 rails 5.1 应用程序中执行以下操作:
$(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
但我不断得到:
TypeError:Turbolinks.enableTransitionCache 不是函数。(在 'Turbolinks.enableTransitionCache()' 中,'Turbolinks.enableTransitionCache' 未定义)
我究竟做错了什么?