30 Oct
TinyMCE e Rails/AJAX
Il tinyMCE è un Editor WYSIWYG Javascript veramente potente, specialmete se fate dei vostri plugin per fare l’upload delle immagini e dei documenti, e qualcosa per la gestione dei link!
Se usate il tinyMCE sulle vostre textarea in form normali funziona tutto alla prima… se vi venisse in mente di usarlo in form Ajax vedrete che non funziona… Maledizione! Per ovviare al problema dovete forzare la copia del testo modificato con il TinyMCE nella textarea originale, quella che viene poi passata come parametro sull’onSubmit, usando questo metodo:
tinyMCE.triggerSave(true,true)
Magari potete metterlo sul before della vostra chiamata Ajax:
1 <%= form_remote_for :obj, 2 :url => {:action => :prova}, 3 :before => "tinyMCE.triggerSave(true,true)" %>


I really like TinyMCE and I do use it whenever an editor is needed. I’m still suprised about how things get so simple just by using Rails. Three lines of code and, voilà, the coolest WYSIWYG editor right in front of you.
Sorry for not speaking italian, but I can understand a little. Congratulations for the blog!
Many tnx!!