Easy FCKEditor Rails plugin
ramos.gaston [at] gmail [dot] com
Easy FCKEditor is a Rails Plugin thats generate a WYSIWYG text editor helper. This version is a fork of Scott Rutherford [great plugin](http://blog.caronsoftware.com/2007/11/16/fckeditor-plugin-0-4-2-released) with a [EasyUpload plugin](http://martinezdelizarrondo.com/easyupload/) inlcuded of Alfonso Martínez de Lizarrondo.
This plugin installs the FCKeditor editor into your rails app, along with some helpers to use in your views.
- WYSIWYG text editor helper.
- 2 configurable versions of upload images module (easy and complete).
- Easy link maker.
This plugin is tested with:
- Rails 2.2 and 2.3
- Ruby 1.8.6 Patchlevel 114
- FCKeditor 2.6.3
If you got this using:
ruby script/plugin install git://github.com/gramos/easy-fckeditor.git
Then the install should of copied all the appropriate files to their homes. If you download a tar then you can either dorake fckeditor:install
from the root of your app, or the file will be installed the first time you startup after untaring the plugin.
Then the install should run task:rake fckeditor:uninstall
and all the installed files will be removed.
and modify the FCKRelativePath = ’’; to suite your needs.
For example if I have an app at www.mydomain.com/app/
then the line should read:FCKRelativePath = ‘/app’;
Then instead of the normal textarea helper from Rails use this one<% = fckeditor_textarea(“object”, “field”, :toolbarSet => ‘Simple’, :width => ‘100%’, :height => ‘200px’) %>
and for use Easy toolbar with EasyUpload plugin<% = fckeditor_textarea(“object”, “field”, :toolbarSet => ‘Easy’, :width => ‘100%’, :height => ‘200px’) %>
Thats it unless you are using AJAX
To use a remote form you need to do something like this<%= form_remote_tag :url => @options.merge(:controller => @scaffold_controller), :before => fckeditor_before_js(‘note’, ‘text’) %> <%= fckeditor_textarea( “note”, “text”, :ajax => true ) %> <%= end_form_tag %>
If you forget to put in the :before it won’t work, you can also use the fckeditor_form_remote_tag described below
Multiple Editors in a form
To create a form using multiple editors use the fckeditor_form_remote_tag helper and pass the :editors option. This takes an hash of model symbol keys with each having
an array as its value. The array should contain the list of fields that will have editors attached to them.
There is also a fckeditor_remote_form_for version.
Basically ensure you have aspell installed and available in your path. If running on Windows then the expected install path is:‘c:\program files\aspell\bin\aspell’
If you install elsewhere then you will need to update spell_check.rb in the plugin to mirror your path. Also make sure you have this line in your fckcustom.js file:FCKConfig.SpellChecker = ‘SpellerPages’;
There is a lighthouseapp account if you want to send a patch or report a bug