1,安装kindeditor
在Gemfile中加入kindeditor的gem
$ gem 'rails_kindeditor'
运行下列命令:
$ bundle install (安装新加的gem)
$ rails g rails_kindeditor:install
#上面指令会在rails工程下的config/initializers/下生成rails_kindeditor.rb
#在app/assets/javascript/application.js中会自动加入
//= require kindeditor
解决上传图片和文件时出现的方法错误,加入一下参数配置
uploadJson : '/kindeditor/upload',
fileManagerJson : '/kindeditor/filemanager',
allowFileManager : true
kindeditor官方文件: http://kindeditor.net/docs/index.html
一个在网页中显示编辑器的demo: https://github.com/KvApril/kindeditor