kindeditor的使用

之前我在15-1688的新闻系统中也无意间使用了kindeditor,

今天在rails上也用上了这个编辑器

小记于此

感谢https://github.com/mlzboy/kindeditor

在安装的时候有一些问题使用bundle install,指定git装不上去反尔是

gem 'kindeditor'

gem 'paperclip', :git => 'http://github.com/thoughtbot/paperclip.git'

这样就装上去了

之后要运行

rails g kindeditor:install

rails db:migrate

这样就基本ok了,

再参照,readme所说的

  • kindeditor helper to layout that you want to use it

    <%=kindeditor_javacript_include_tag%>

  • add a id "kindeditor" to your textarea

        <%= f.text_area :memo,:id => "kindeditor" %>



    之前我还试了同一作者改的tiny-mce由于依赖太多了,其中有一个是responed-to-parent gem,在svn库我不知道如何安装,就放弃了,


    另外好像在rails3下作为编辑器的选择还是很多的,还且个ckeditor它使用的是attachment_fu,我未曾尝试工,罗列于此,

    主要是kindeditor之前我也用过,然后paperclip在我应用中也用了,看来是个挺完美的结合,呵呵


    另外在github上下东西好慢,可能又是网络的问题了,很闹心

原文地址:https://www.cnblogs.com/lexus/p/1885262.html