I'm working on subverting FCKeditor to serve as a text editor, a sort of enhanced textarea with nice features such as Print, Find and Undo/Redo.
#593 Start the editor in Source mode includes a patch which I applied. This appears to do what I want.
However, I do have a problem with this which I hope is a simple newbie issue. Following html/sample02.html, I set up a page to ReplaceTextarea in a view in my Rails app (no, I'm not using a Rails plugin for this -- it would be overkill in my case). The code is as follows:
<form action="/file/save/<%= params[:id] %>" method="post"> <div> <textarea name="file" rows="30" cols="80" style="width: 100%; height: 400px"><%= @file %></textarea> </div> <br /> </form>
When I press Save, what is submitted is the original contents of the textarea, not the new contents. This resembles viewtopic.php?f=6&t=10299 but I don't understand his solution -- it involves Ajax which I don't use here. My assumption is that pressing Save does an ordinary form submit, and that it ought to submit the changed value. Is this assumption incorrect?
I must have done something foolish here and someone should be able to set me straight fairly quickly. Please assist.
To make FCKeditor behave as a text editor, I also remove any HTML-related buttons from the buttonbar so that it is always in Source mode and can't be switched out. Is this a reasonable approach? Are there any other "gotchas" I haven't considered? I do see that there is an issue with Replace not working in Source mode (someone else filed a ticket on this already, but I don't have the URL at my fingertips) but we could live without that for now.