Ask A Question


You’re not receiving notifications from this thread.

Adding Turbolinks Compatibility to SimpleMDE Markdown Editor Discussion

Jordano Moscoso Jordano Moscoso

I prefer to remove turbolinks because libraries dont work nice with it, but would be great to know how to make them all compatible with turbolinks.


Great episode, thanks Chris!

I've been struggling with Front-end frameworks, like Bootstrap and others. The JavaScript components only work on initial page load (or after a page refresh).

I've tried using jQuery turbolinks, but never seems to help. Would love to hear your approach on how to get around this.

Thanks again!


The simple solution for most of Bootstrap is just to use the turbolinks:load event for re-initializing your JS. For example, to enable tooltips and popovers for all pages, you can do:

$(document).on 'turbolinks:load', ->

Some of the other things like bootstrap modals don't need this because the JS is written in a way that makes it automatically compatible from what I've seen. Bootstrap 3 doesn't have too many compatibility issues with Turbolinks 5 these days.


Thanks Chris for this video.

Would you mind to cover how to upload images to SimpleMDE like in WordPress editor?


Browse photo(s) -> the photo(s) get displayed directly on the text editor.

Thank you!

Example screenshot:


Thank you Chris!
I wish a complete video about how to Integrate simplemde and rails。


For those of you using CKEditor the trick is a little bit more complicated.
I would recommend reading Gambala comment for Turbolink 5 (near the bottom):


better write your updating here

simplemde = null

cleanupSimpleMDE = ->
if simplemde?
simplemde = null

$(window).on 'popstate', cleanupSimpleMDE
$(document).on 'turbolinks:before-visit', cleanupSimpleMDE

$(document).on "turbolinks:load", ->
simplemde = new SimpleMDE()

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,969+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.