So, you want to integrate the brand spanking new CKEditor 3.0 and Rails? I can show you how to do it without Rails even getting involved, if you use jQuery!
There are a few plugins, but you don’t really need them, unless you’re doing File Uploads, in which case use the second one and wait till someone makes it 3.0 compatible!
Anyway, in order to use CKEditor 3.0 and Rails, you just need to untar the tarball into RAILS_ROOT/public/javascripts/ and then enable it by putting the following in app/views/layouts/application.haml:
javascript_include_tag 'ckeditor/ckeditor.js'
And, now, use the jQuery recipe from here which allows you to find all textareas and replace them with CKEditor enabled textareas.
$(function() {
if ($('textarea').length > 0)
{
var data = $('textarea');
$.each(data, function(i)
{
CKEDITOR.replace(data[i].id);
}
);
}
});
Your rails app doesn’t care, because all it is expecting is the input from a textarea so it may make sense to just keep this strictly client side. Of course you can’t write tests against it easily.
