Skip to content

Instantly share code, notes, and snippets.

@descovi
Last active May 8, 2020 14:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save descovi/c237df3770b223acf3c3de6c3cd38226 to your computer and use it in GitHub Desktop.
Save descovi/c237df3770b223acf3c3de6c3cd38226 to your computer and use it in GitHub Desktop.
Selectize e Turbolinks
document.addEventListener("turbolinks:load", function() {
$('.selectize').selectize()
})
document.addEventListener('turbolinks:before-cache', function(){
$('.selectize').each(function(){
if (this.selectize != undefined) {
this.selectize.destroy()
}
})
})
@marcelokanzaki
Copy link

Thank you. I've spent an hour and a half on this 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment