论坛首页 编程语言技术论坛

宝典:第三式 FCKeditor插件实现富文本编辑

浏览 3777 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-04-23  
首先下载
ruby script/plugin install svn://rubyforge.org/var/svn/fckeditorp/trunk/fckeditor


其他说明:
(1)FCKeditor安装在项目根目录下的vendor/plugins/fckeditor 里,
(2)README文件代有使用说明

在你要使用是视图上添上
<%= javascript_include_tag :fckeditor %>


<%= javascript_include_tag "fckeditor/fckeditor" %>


在需要富文本的Form表单用如下语句生成一个富文件编辑框:
<%= fckeditor_textarea("object", "field", :toolbarSet => 'Simple', :width => '100%', :height => '200px') %>


说明:object对应模型对象,field对应它的字段。


如果是用了ajax,则需要在form_remote_tag加上一个before项

 <%= form_remote_tag(:update => update,
                      :before => fckeditor_before_js('topic', 'content'),
                      :url => {:controller => 'topics', :action => 'create', :template => 'show'} )%>


并且富文件编辑框要加一个ajax=true的选项:

<%= fckeditor_textarea(:topic, :content, :ajax => true, :toolbarKit => 'Simple', :width => '100%', :height => '600px') %>


   发表时间:2008-04-25  
为什么fckeditor上传的图片能够公用?
0 请登录后投票
   发表时间:2008-04-25  
这个具体不是很清楚, 但是它的上传图片都放在public\uploads\Image文件夹下
0 请登录后投票
   发表时间:2008-04-25  
有点郁闷,其他人上传时能够看到这个文件夹里面的所有图片
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics