Javascript with Turbolinks in Rails 4

Updated . Posted . Visible to the public. Repeats.

If some of your scripts don't work with turbolinks, you should do the following:

ready = ->
  #your code here
  
$(document).ready(ready)
$(document).on('page:load', ready)

konjoot
Last edit
konjoot
Keywords
Javascript, Turbolinks, Rails4
Posted by konjoot to wiki (2013-12-11 15:40)