Easy FCKEditor plugin

Plugin details

Easy FCKEditor is a Rails Plugin thats generate a WYSIWYG text editor helper.

Websitehttp://github.com/gramos/easy-fckeditor Repositorygit://github.com/gramos/easy-fckeditor.git Tags editor LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/gramos/easy-fckeditor.git

Usage
-----------
Basically include this in the page you wish to use the editor in

<%= javascript_include_tag :fckeditor %>


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
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.

<%= fckeditor_form_remote_tag :url => @options.merge(:controller => @scaffold_controller),
                            :editors => { :multinote => ['text1', 'text2'] } %>
<%= fckeditor_textarea( "multinote", "text1", :ajax => true ) %>
<%= fckeditor_textarea( "multinote", "text2", :ajax => true ) %>
<%= end_form_tag %>


There is also a fckeditor_remote_form_for version.

Spell Check
-----------------------
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';

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago