spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
815 stars 256 forks source link

Showing nothing #203

Open kobiljonergashev opened 8 years ago

kobiljonergashev commented 8 years ago

I'm using class="nested-fields" within my form. I've done all the instructions, but nothing happens. Is there any tips?

jheysen commented 8 years ago

In my case I just included the gem as per the Readme, and the editor is just not showing up. I see that the assets are being sent to the browser, and the browser console has recognized the javascript functions, so I don't really know what's going on

Shwetakale commented 8 years ago

@jheysen Same thing is happening with me. But when I am doing manual initialization it is working fine

<%= text_area_tag :editor, "", :rows => 40, :cols => 120 %>

<script type="text/javascript">

  tinyMCE.init({
    selector: 'textarea.editor'
  });
</script>

I am trying to find out reason but till then we can manually initialize it.

jheysen commented 8 years ago

I found the solution. After declaring the textarea with tinymce class I had to add:

<%= tinymce_assets %> <%= tinymce %>

This should be reflected on the documentation

Hope it helps!

Shwetakale commented 8 years ago

@jheysen Thanks but it doesn't seem to to be mandatory step as per documentation. And if already do it through application.js then I don't think requiring per page should be required and if yes then it will be great if you send PR for this.