rails3.1 kindeditor安装(javascript框架)

1.安装kindeditor插件
rails plugin install git://github.com/doabit/kindeditor.git
或gem install kindeditor

rails g kindeditor:install

2.在项目文件Gemfile中添加下面两句
gem 'kindeditor' 
gem 'paperclip'

3.运行
rake db:migrate

4. controller层添加如下代码
include_kindeditor
or
include_kindeditor nly => [:new, :edit]

5.在页面上添加如下:
<%= include_kindeditor_if_needed %>
注意:rails3.1以上,需将javascript考到assets/javascripts目录下(统一规范),如在layouts添加,需去掉<%=javascript_include_tag 'application'%>

6.页面上所要用到html编辑器的地方添加id="kindeditor"

7.id="kindeditor"可以进行修改,主要是在kindeditor中进行修改
kindeditor_config.js

你可能感兴趣的:(Rails,kindeditor)