Special thanks goes to Bill Garr of thinkabout.com who figured this one out. Hope he doesn’t mind I share it with the rest of the Rails community.
in /vendor/plugins/active_scaffold
* /javascripts/activescaffold.js
1. in ActiveScaffold.ActionLink.Abstract.prototype definition (~ line 220)
onComplete: function(request) {
this.loading_indicator.style.visibility = 'hidden';
init_tinyMCE();
}.bind(this)
2. in /views/_update_form.rhtml
url_options,
:before => "update_from_tinyMCE(this);",
:after => "$('#{loading_indicator_id(:action => :update, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{element_form_id(:action => :update)}');",
:complete => "$('#{loading_indicator_id(:action => :update, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{element_form_id(:action => :update)}');",
:failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
:html => {
:href => url_for(url_options),
:id => element_form_id(:action => :update),
:class => 'update',
:method => :put
} %>
3. in your application.js (or any other .js that will be loaded)
function init_tinyMCE(){
if (!tinyMCE) return;
tinyMCE.isLoaded = false;
tinyMCE.onLoad();
}
function update_from_tinyMCE(form){
if (!tinyMCE || !form) return;
tinyMCE.triggerSave();
}
4. finally, you have to override the field display of every field that gets modified by tinyMCE. All you have to do is to change the default cleanup function, h(), to sanitize(), like so:
def body_column(record)
sanitize(record.body)
end
5. Restart Rails