rob
May 15th, 2005, 06:02 PM
If you're designing an app that has a field for data that will appear on a webpage, you probably would like to have a nice interface for entering HTML-ized text there.
FCKEditor, for me anyway, fits that requirement nicely. It's easy to install into your views as well. Simply download FCKEditor from http://www.fckeditor.net/ and unzip it to a folder in your public directory called 'fckeditor'. The tarball will archive the files directly, so make sure you have the dir made and the tarball moved into it before you extract.
Once you're done, insert the following code into the rhtml file of the view you wish to have the editor:
<p><label for="item_description">Description</label><br/>
<script type="text/javascript" src="/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
<!--
var oFCKeditor = new FCKeditor( 'item[description]' );
oFCKeditor.BasePath = '/fckeditor/';
oFCKeditor.Value = '<%= @item.description %>';
oFCKeditor.Create() ;
//-->
</script>
</p>
In the above example, a textbox is created called 'item[description]'. Name it appropriately for your situation.
This is just a basic setup though, you can add other variables to the oFCKeditor object to further customize it. For more information about the variables, see the documentation and samples that come with FCKEditor.
Robert
FCKEditor, for me anyway, fits that requirement nicely. It's easy to install into your views as well. Simply download FCKEditor from http://www.fckeditor.net/ and unzip it to a folder in your public directory called 'fckeditor'. The tarball will archive the files directly, so make sure you have the dir made and the tarball moved into it before you extract.
Once you're done, insert the following code into the rhtml file of the view you wish to have the editor:
<p><label for="item_description">Description</label><br/>
<script type="text/javascript" src="/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
<!--
var oFCKeditor = new FCKeditor( 'item[description]' );
oFCKeditor.BasePath = '/fckeditor/';
oFCKeditor.Value = '<%= @item.description %>';
oFCKeditor.Create() ;
//-->
</script>
</p>
In the above example, a textbox is created called 'item[description]'. Name it appropriately for your situation.
This is just a basic setup though, you can add other variables to the oFCKeditor object to further customize it. For more information about the variables, see the documentation and samples that come with FCKEditor.
Robert