Jared Blitzstein on 11 Jul 2006 01:15:46 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PhillyOnRails] TinyMCE with prototype Ajax.Updater


I've been trying to get TinyMCE (and even FCKeditor) to work in the following scenario. I have a view with a snippet like this

<div id="data_section">
<%= render :partial => "data_section"%>
</div>

inside that div is an image with a link_to_remote and some text. When clicked, data_section is replace with a form_remote_tag, textarea, and a submit button (same code as below, just in a partial loaded by Ajax.Updater)

But I'm having trouble getting that textarea to be a TinyMCE editor. What happens is when that link_to_remote image is clicked, a blank page replaces the current page and just sits there "loading".

I'm pretty sure this has nothing to do with script.aculo.us because I can load both of the editors in a page (tinyMCE example below), it's just with the Ajax.Updater call I get the problem mentioned before. 

<%= text_area 'contents', 'data', {:style => "width: 100%;", :class => "tiny_mce"}  %>

<script language="_javascript_" type="text/_javascript_">
tinyMCE.init({
mode : "textareas"
});
</script>


Any help would be appreciated. And yes, I searched around google and read the wiki's, but they don't mention the problem I'm having or anything with AJAX, just the js includes order, which mine is pasted below for good measure.

<script src="" type="text/_javascript_"></script>
<script src="" type="text/_javascript_"></script>
<script src="" type="text/_javascript_"></script>
<script src="" type="text/_javascript_"></script>
_______________________________________________
talk mailing list
talk@phillyonrails.org
http://lists.phillyonrails.org/mailman/listinfo/talk