spohlenz / tinymce-rails

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

Force evaluation of preinit.js.erb file at first #182

Closed dziemian007 closed 8 years ago

dziemian007 commented 8 years ago

I tried to use TinyMCE along with Rails deployed to subdirectory.

All should work fine, as it's already supported. relative_url_root is read and passed to js

But while I was debugging problem, I found out that here base has default value /assets/tinymce. I though it's caused by wrong order of loading js files, but that's also not the case. It seems that window.tinymce = ... is not evaluated, so I wrapped it into anonymous function call.

EDIT: Explicitly setting tinyMCE.baseURL fixes issue, as mentioned here https://github.com/spohlenz/tinymce-rails/issues/133, but it would be nice not have to do it :smile:

spohlenz commented 8 years ago

I'm wondering if your original issue was a Sprockets caching issue. Try running rake tmp:cache:clear after making a change to relative_url_root.

Theoretically, wrapping the block in an additional function call should have no effect, but changing the code may have caused the cache to be invalidated.

dziemian007 commented 8 years ago

Yes, that was it :smile: Thank you !!!