R
R
railshello2014-07-05 15:29:53
Ruby on Rails
railshello, 2014-07-05 15:29:53

Why is the script from the bootstrap-wysihtml5-rails gem not loading?

When I go to posts#new , wysihtml5 is not loaded.
After refreshing the page, everything becomes immediately visible.
I use turbolinks . Rails version 4.0.1
How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Chernov, 2014-07-05
@peanut

There is a little explanation in the gem help for those who use turbolinks.
In short, try to initialize the editor on the form like this:

$(document).on('ready page:load', function(){
  window['rangy'].initialized = false;
  $('.wysihtml5').wysihtml5();
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question