fckeditor插件使用和rails2.3不兼容的解决办法
下载包解压放到当前项目主目录下 vendor\plugins\fckeditor目录中
rake fckeditor:intall
在项目目录中出现 public\javascripts\fckeditor
里面是产生的JS文件。
在更新了Rails2.3后发现和fckeditor出现了兼容性问题。
undefined method `relative_url_root' for #
搜了一下找到解决办法如下。主要是路径PATH问题
先到 目录 vendor\plugins\fckeditor
找到文件 app/controllers/fckeditor_controller.rb
look for uploaded = request.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
replace it with this uploaded = ActionController::Base.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
同样在文件 lib/fckeditor.rb
replace
js_path = "#{request.relative_url_root}/javascripts"
with
js_path = "#{ActionController::Base.relative_url_root}/javascripts"
reference:
restart web server it works!
下载包解压放到当前项目主目录下 vendor\plugins\fckeditor目录中
rake fckeditor:intall
在项目目录中出现 public\javascripts\fckeditor
里面是产生的JS文件。
在更新了Rails2.3后发现和fckeditor出现了兼容性问题。
undefined method `relative_url_root' for #
搜了一下找到解决办法如下。主要是路径PATH问题
先到 目录 vendor\plugins\fckeditor
找到文件 app/controllers/fckeditor_controller.rb
look for uploaded = request.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
replace it with this uploaded = ActionController::Base.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
同样在文件 lib/fckeditor.rb
replace
js_path = "#{request.relative_url_root}/javascripts"
with
js_path = "#{ActionController::Base.relative_url_root}/javascripts"
reference:
restart web server it works!