ruby on rails 中使用kind editor

来源:互联网 发布:淘宝网大学 编辑:程序博客网 时间:2024/05/03 10:59

新手上路

在gemfile中加入

gem 'rails_kindeditor'运行bundle引入
运行
rails generate rails_kindeditor:install安装该应用注意你的工程里面必须有application.js文件
运行
rake kindeditor:assets
将kindeditor复制到public文件下

然后在文件中使用

  1. <%= kindeditor_tag :content, 'default content value' %>     或者 <%= kindeditor_tag :content, 'default content value', :width => 800, :height => 300 %>    或者<%= kindeditor_tag :content, 'default content value', :allowFileManager => false %>
 2. <%= form_for @article do |f| %>       ...       <%= f.kindeditor :content %>       # or <%= f.kindeditor :content, :width => 800, :height => 300 %>       # or <%= f.kindeditor :content, :allowFileManager => false %>       ...     <% end %>


0 0