sto usando Rails 3.2.3, e quando i carichi TinyMCE in produzione, ottengo quattro 404s:Impossibile modificare DocumentBaseUrl in TinyMCE
"NetworkError: 404 Not Found - http://[my-domain]/[current-path]//langs/en.js"
"NetworkError: 404 Not Found - http://[my-domain]/[current-path]//plugins/fullscreen/editor_plugin.js"
"NetworkError: 404 Not Found - http://[my-domain]/[current-path]//themes/advanced/editor_template.js"
"NetworkError: 404 Not Found - http://[my-domain]/[current-path]//plugins/media/editor_plugin.js"
Forse questi file vengono chiamati in modo asincrono da tiny_mce.js perché non sono elencati nella mia fonte. I miei js aspetto:
tinyMCE.init({
theme: "advanced",
mode: "textareas",
plugins: "fullscreen, media",
height: 300,
relative_urls :true,
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,search,replace,|,bullist,numlist,|,outdent,indent,|undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,hr,removeformat,visualaid,|,sub,sup,|,fullscreen,spellchecker",
theme_advanced_buttons2 : "styleselect,formatselect,imageListBox,media",
theme_advanced_buttons3 : "",
editor_selector : "mceEditor",
extended_valid_elements : "form[action|accept|accept-charset|enctype|method|name|onsubmit|id|name]",
convert_urls : false,
remove_script_host : false
});
function toggleTinyMCE(id) {
if (!tinyMCE.get(id))
tinyMCE.execCommand('mceAddControl', false, id);
else
tinyMCE.execCommand('mceRemoveControl', false, id);
}
tutti i miei file TinyMCE sono nella directory app/beni/javascript/tiny_mce, così ho provato ad aggiungere document_base_url
e base_url
ai miei init params, ma non importa ciò che li ho impostato , quando ispeziono TinyMCE in Firebug, vedo che i loro valori non cambiano a quello che ho inserito.
Sono consapevole che un plugin Rails da kete esiste per TinyMCE, ma its README afferma che non è consigliabile per Rails> = 3.1
La risposta su questa questione ha aiutato molto: http: // StackOverflow. it/questions/7325364/tinymce-loading-lang-plugins-theme-from-errato-directory –