Problem with page integrations/rails.md
jamesw opened this issue · 0 comments
Trying to implement self hosted tinymce integration in a rails engine using importmaps and the paths to the subfolders such as plugins are not found, the documentation would be good if it included how to use tinymce with importmaps in Rails 7+ as I am unable to make this work at all.
I have the tinymce.min.js with the sub folder in app/javascripts/my_engine_name/
I have added
pin "ccs_cms/custom_page/tinymce/tinymce.min"
to importmap.rb
I am loading the tinymce.min.js in the head of my layout using
<%= javascript_import_module_tag 'ccs_cms/custom_page/tinymce/tinymce.min' %>
This configuration works in as far as tinymce loads but does not display and the console reports a huge number of 404 errors for themes and plugins folders e.g.
GET
http://localhost:3000/admin_dashboard/page_maintenance/something-new//themes/silver/theme.js
[HTTP/1.1 404 Not Found 59ms]
The documentation needs to describe how to set the paths correctly or how to implement this solution with importmaps in a Rails 7 application, does not have to be in an engine as the same issue is applicable, this may just be an issue with the way the importmap is pinned and maybe a download option should be used and tinymce should be in the vendors folder
affected page: https://www.tiny.cloud/docs/integrations/rails/