簡體   English   中英

如何在Rails 3應用程序中插入CKEditor插件?

[英]How to insert a CKEditor plugin in a Rails 3 app?

我正在嘗試為CKEditor使用wordcouter插件。 我跟着這個 ,但似乎沒有用。 經過一番探索后,我發現有很多不同的config.js文件和眾多的plugin目錄。 我應該使用哪一個?

app/assets/ckeditor/plugins/
app/assets/ckeditor/_source/plugins/
app/assets/javascripts/ckeditor/plugins/
app/assets/javascripts/ckeditor/_source/plugins/
app/assets/javascripts/ckeditor/_source/core/plugins.js
app/assets/ckeditor/_source/core/plugins.js

當我解壓wordcount時,它給了我一個名為wordcount_1.05的目錄,我應該將它重命名為wordcount嗎?

我在config.js文件中鍵入以下內容:

config.extraPlugins = 'wordcount';

config.wordcount = {

      // Whether or not you want to show the Word Count
      showWordCount: true,

      // Whether or not you want to show the Char Count
      showCharCount: false
};

但這似乎根本沒有做任何事情。 如果我稍微修改它(這只適用於我的app / assets / javascripts / ckeditor / config.js文件)來實現它:

CKEDITOR.config然后我的文本框完全停止顯示。 所以我覺得這是要修改的正確文件。

謝謝您的幫助!

將插件目錄放在app / assets / javascripts / ckeditor / plugins /中(在Rails 4中為我工作)

您需要從http://ckeditor.com/addon/notification下載Notification插件

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM