<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>里克的自习室 &#187; fckeditor</title>
	<atom:link href="http://railser.cn/blog/tag/fckeditor/feed" rel="self" type="application/rss+xml" />
	<link>http://railser.cn</link>
	<description>关注Ruby和Rails的学习与开发</description>
	<lastBuildDate>Sun, 26 Feb 2012 12:20:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Fckeditor on Rails的问题和临时解决办法</title>
		<link>http://railser.cn/blog/fckeditor-on-rails-problems-and-solutions</link>
		<comments>http://railser.cn/blog/fckeditor-on-rails-problems-and-solutions#comments</comments>
		<pubDate>Sun, 08 Feb 2009 07:25:26 +0000</pubDate>
		<dc:creator>里克</dc:creator>
				<category><![CDATA[RailsNote]]></category>
		<category><![CDATA[fckeditor]]></category>

		<guid isPermaLink="false">http://railser.cn/?p=356</guid>
		<description><![CDATA[在目前的项目中使用了Fckeditor On Rails插件，没想到碰到很不少问题，网上google一下，发现大家都有这样的问题，有的是这个plugin的问题，有的是fck的问题。为了方便日后对系统的管理，在此笔记一下目前碰到的诸多问题和临时的解决办法。 问题： 1、无法编辑内容，编辑时出现js问题 2、上传图片时无法准确放入指定Image文件夹路径中 3、上传文件时无法得到params[:Type]变量 4、无法使用 fckeditor 的文件上传配置 5、上传中文rar文件时，出现110错误提示 解决： 1、插件似乎没有考虑修改的问题，之前我的asp做的EZAdmin中，简单的传递内容即可，现在看来插件里并没有去处理传进来的value属性，所以在fckeditor.rb中增加了这个方法，使之能够编辑内容。 2、图片可以传递入Image文件夹内，但是结果中没有后面的文件名，具体原因似乎是版本的事情，这个暂时不去对比了，改了fckeditor_controller.rb中的返回值内容，也就是使 OnUploadCompleted的第二个参数带上了文件名，暂时得以解决。 3、问题同2类似，这时无法得到params[:Type]参数，看了下fck_image.js里，对图片上传设置了type属性为image，但是文件上传，或者叫Link上传时，没有设置这个属性。所以在fckeditor_controller.rb中，当该属性为空时，设置为File。这个修改非常危险，但是目前没有更好的方法。 4、在文件上传时，作者自定义了MIME_TYPE数组，来做校验。这个有点。。。。所以暂时将几个类型加上，解决doc,zip,rar等文件上传先。 application/msword application/x-zip-compressed application/octet-stream （rar的） 5、当上面都解决完，发现对中文名文件无法上传，哭吧。。。。。。 下面是我修改完的Fckeditor on Rails plugin，希望朋友们多指正问题。谢谢。 说明：plugin版本：0.5.1，Rails版本：2.1.2，两个部分的，不用安装了。 fckeditor051-for-rails212 javascripts 后记： 记得每次修改完插件内容后要重启一下服务]]></description>
			<content:encoded><![CDATA[<p>在目前的项目中使用了Fckeditor On Rails插件，没想到碰到很不少问题，网上google一下，发现大家都有这样的问题，有的是这个plugin的问题，有的是fck的问题。为了方便日后对系统的管理，在此笔记一下目前碰到的诸多问题和临时的解决办法。</p>
<p>问题：</p>
<p>1、无法编辑内容，编辑时出现js问题</p>
<p>2、上传图片时无法准确放入指定Image文件夹路径中</p>
<p>3、上传文件时无法得到params[:Type]变量</p>
<p>4、无法使用 fckeditor 的文件上传配置</p>
<p>5、上传中文rar文件时，出现110错误提示</p>
<p>解决：</p>
<p>1、插件似乎没有考虑修改的问题，之前我的asp做的EZAdmin中，简单的传递内容即可，现在看来插件里并没有去处理传进来的value属性，所以在fckeditor.rb中增加了这个方法，使之能够编辑内容。</p>
<p>2、图片可以传递入Image文件夹内，但是结果中没有后面的文件名，具体原因似乎是版本的事情，这个暂时不去对比了，改了fckeditor_controller.rb中的返回值内容，也就是使 <span style="color: #ff0000;">OnUploadCompleted的第二个参数带上了文件名</span>，暂时得以解决。</p>
<p>3、问题同2类似，这时无法得到params[:Type]参数，看了下fck_image.js里，对图片上传设置了type属性为image，<span style="color: #ff0000;">但是文件上传，或者叫Link上传时，没有设置这个属性</span>。所以在fckeditor_controller.rb中，当该属性为空时，设置为File。这个修改<span style="color: #ff0000;">非常危险</span>，但是目前没有更好的方法。</p>
<p>4、在文件上传时，作者自定义了MIME_TYPE数组，来做校验。这个有点。。。。所以暂时将几个类型加上，解决doc,zip,rar等文件上传先。</p>
<p>application/msword</p>
<p>application/x-zip-compressed</p>
<p>application/octet-stream （rar的）</p>
<p>5、当上面都解决完，发现对中文名文件无法上传，哭吧。。。。。。</p>
<p>下面是我修改完的Fckeditor on Rails plugin，希望朋友们多指正问题。谢谢。</p>
<p>说明：plugin版本：0.5.1，Rails版本：2.1.2，两个部分的，不用安装了。</p>
<p><a href="http://railser.cn/wp-content/uploads/fckeditor051-for-rails212.rar" target="_blank">fckeditor051-for-rails212</a></p>
<p><a href="http://railser.cn/wp-content/uploads/javascripts.rar" target="_blank">javascripts</a></p>
<p>后记：</p>
<p>记得每次修改完插件内容后要重启一下服务</p>
]]></content:encoded>
			<wfw:commentRss>http://railser.cn/blog/fckeditor-on-rails-problems-and-solutions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

