FCKEditor与rails的集成
1.下载 fckeditor_plugin-0.3.2.zip ,目前版本为0.3.2 2.解压到vendor\plugins目录下,并且重新命名为fckeditor 3.到该应用程序根目录下,然后运行rake fckeditor:install,则执行自动安装 4.在自己的view层中添加 <%= javascript_include_tag :fckeditor %> 以及在你需要编辑的字段textarea替换为 <%= fckeditor_textarea("book", "desc", { :toolbarKit => 'Simple', :width => '100%', :height => '200px' }) %> 第一个参数为你的domain对象,desc为你的编辑字段值,其他顾名思义 然后运行你的页面程序,发现simple upload有点bug,上传后javascript报错 5.追踪代码发现 vendor\plugins\fckeditor\app\controllers\fckeditor_controller.rb下的 def upload self.upload_file end 调用了upload_file方法 def upload_file @new_file = params[:NewFile] @url = upload_directory