rails fckeditor配置使用

来源:互联网 发布:部落冲突治疗升级数据 编辑:程序博客网 时间:2024/05/21 20:27

rails fckeditor配置使用

1.下载fckeditor,http://rubyforge.org/projects/fckeditorp/

2.解压到vendor/plugins目录下,并且重新命名为fckeditor
3.到该应用程序根目录下,然后运行rake fckeditor:install,则执行自动安装
4.在自己的view层中添加
<%= javascript_include_tag :fckeditor %>
以及在你需要编辑的字段textarea替换为
<%= fckeditor_textarea("book", "desc", { :toolbarSet=> 'Simple', :width => '100%', :height => '200px' }) %>
第一个参数为你的domain对象,desc为你的编辑字段值,其他顾名思义

 

问题:上传完相片后界面停止在那个地方不动,需要修改文件(fckeditor_controller.rb):

将原始的upload方法替换为: