UPDATE: NOVEMBER 20TH, 2007 – There is now a tinymce plugin for rails. How to get it and install it can be found on the rails wiki.
This is a follow up to the prior post on how to use TinyMCE in your rails app. I have been able to get the imagemanager and filemanager plugins working successfully within my rails app and here’s how I did it. I’m repeating alot of my prior post so you don’t have to jump around.
There’s alot of discussions about how to integrate Fckeditor into your rails app, but what about TinyMCE? I prefer Tiny over FCK because Tiny encloses carriage returns with paragraph tags where FCK uses line breaks. I think it keeps things simple and when there is a person who’s not too knowledgeable about html (most clients), it helps keep them inline.
So, here’s how I integrate TinyMCE into my rails app. It’s much simpler than the FCK route.
1. Download TinyMCE from http://tinymce.moxiecode.com/download.php.
3. In your view, place the following script into your head tag.
5. In your form view, or wherever your form lives. Call the editor with the following snippet. In my case, I’m using it in a scaffold generated form and the text field is named ‘copy’.
<%= text_area 'pages', 'copy' , :cols => "60", :rows => "20",<br />     :class => 'tiny_mce' %>
var url = this.getScriptPath() + "/../../filemanager/frameset.php?a=b";
That’s the only change I needed to make to get it working. Make sure your images directories are writable and have fun.