tsechingho / ckeditor-rails

Integrate CKEditor javascript library with Rails asset pipeline
https://github.com/tsechingho/ckeditor-rails
MIT License
213 stars 133 forks source link

data-no-turbolink not works #77

Open BrunoQuaresma opened 8 years ago

BrunoQuaresma commented 8 years ago

When i load a second page with ckeditor it is still broken.

<div class="form-group" data-no-turbolink>
  <label for="">Conteúdo da aula</label>
  <p class="form-text text-muted">
    Quer dar mais explicação sobre o conteúdo? Basta utilizar o espaço abaixo.
  </p>
  <%= f.cktext_area :content, cols: 40, ckeditor: { toolbar: 'mini' } %>
</div>
tonyhsu23 commented 8 years ago

As #28 mentioned, maybe try to reload ckeditor with script so that you don't need to do anything about turbolinks. something like...

<%= f.cktext_area :content, id: “ckeditor” %>
$(document).on(‘ready page:load’, function () {
  CKEDITOR.replace(‘ckeditor’);
});
Shwetakale commented 8 years ago

@BrunoQuaresma I think you need to add data-no-turbolink to the link from which ckeditor is loading and not to the form-group on which it is initialized. I tried following and its working fine for me

 %li= link_to "New Recipe", new_recipe_path, data: {"no-turbolink" => true}

and I have ckeditor on new recipe page. Hope this helps.