I have the following:
$ ->
$('[data-provider="summernote"]').each ->
$(this).summernote
height: 300
And this works, however, I would like to make it TurboLinks 5 friendly.
So I tried the following:
$ ->
ready = ->
$('data-provider="summernote"]').each ->
$(this).summernote
height: 300
$(document).ready(ready)
$(document).on('page:load', ready)
But I keep getting this error:
Uncaught ReferenceError: ready is not defined
How do I fix this so that I make the original snippet TL-5 friendly?
Edit 1
By the way, I am doing this in my jobs.coffee
file, which I know is being included in my asset-pipeline. So that's not it.