To paraphrase a common saying, "open source software is only free if your time has no value." Such was the last day of work while trying to integrate ActiveScaffold and FCKeditor. The sad thing is that it really shouldn't have been this way.
OK, I'm finished venting. Let's get to the meat and potatoes. I'm assuming you have a model working with ActiveScaffold, which is generally pretty simple to get up and running.
The two primary resources for installing were the (a) github page for the github fckeditor plugin and the most useful, but slightly incomplete, FCK Editor Plugin in ActiveScaffold. Without further commentary, here are the steps, minus the premature balding inducing frustration.
Install the FCKeditor plugin from within your Rails application:
script/plugin install git://github.com/davividal/fckeditor.git
The following steps relate to a simple admin controller for an equally simple About model.
script/generate model about content:text published:boolean
mkdir -p app/views/admin/about
cp vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.erb app/views/admin/about/
cp vendor/plugins/active_scaffold/frontends/default/views/_update_form.html.erb app/views/admin/about/
The Admin::About controller:
class Admin::AboutController < ApplicationController
The following lines need to be included in your admin layout:
<%= active_scaffold_includes %>
Here's the about helper:
def content_form_column(record, input_name)
fckeditor_textarea(:record, :content, :ajax => true, :width => '800px', :height => '200px')
In the two admin/about partials, you need to replace submit button code with the following:
<input type="submit" value="Update" class="submit"
onClick="var oEditor = FCKeditorAPI.GetInstance('record_<%=@record.id%>_<%='content'%>_editor');
$('record_<%=@record.id%>_<%='content' %>_editor_hidden').value = oEditor.GetXHTML();" />
Substitute Update for Create as appropriate. This last bit is very important, and not mentioned pretty much anywhere except Ganesh's post. You'll notice one important difference from his code though: when assigning the hidden variable you need to actually add the "_hidden" part to the id.
Hopefully this helps someone roll with FCKeditor and ActiveScaffold (or Ajax in general) without wasting their Labor Day Sunday as I did. Let me know if something doesn't work. I know that input statement needs real angle brackets, but I'm too tired to debug that display issue just this minute.
UPDATE: Since all my new projects use jQuery, I'll be switching to this jQuery.wysiwyg.