galetahub / ckeditor

Ckeditor 4.x integration gem for rails

Home Page:https://ckeditor.com/ckeditor-4/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix documentation for "Install additional plugins" (v5+). Codemirror example.

rgalea opened this issue · comments

Thank you for creating and supporting this gem.

The documentation under "Install additional plugins" is not correct. I am specifically talking about trying to add a plugin not supported by the CDN (in my case codemirror). If I just add a config.extraPlugins line to the config ckeditor.js will try and pull the assets from the CDN which will result in a 404.

My solution was:

  1. Add the plugin assets under /public/ckeditor/plugins/
  2. Add CKEDITOR.plugins.addExternal( 'codemirror', '/ckeditor/plugins/codemirror/' ); to the config.js file
  3. Then add config.extraPlugins = 'codemirror,'; to the config.js file

What I did:

  1. Add the plugin assets under /assets/javascripts/ckeditor/plugins/
  2. CKEDITOR.plugins.addExternal('youtube', '<%=asset_path 'ckeditor/plugins/youtube/plugin.js'%>'); to the head of the html page
  3. Add to assets.rb Rails.application.config.assets.precompile += ['ckeditor/plugins/youtube/plugin.js']
commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.