我使用Rails 3.2.3,当TinyMCE的负荷在生产,我送四个404:无法更改DocumentBaseUrl在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"
也许这些文件是从tiny_mce.js异步调用,因为他们没有列出我的来源。我的JS是这样的:
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);
}
我所有的TinyMCE的文件在目录应用程序/资产/ JavaScript的/ tiny_mce,所以我尝试添加document_base_url
和base_url
我的初始化参数,但无论怎样我现在就写,当我用萤火虫检查TinyMCE时,我发现它们的值不会改变我输入的内容。
我知道一个Rails插件通过凯泰存在TinyMCE的,但its README指出,不建议为Rails> = 3.1
对这个问题的答案帮助了很多符合的资产pipline。 COM /问题/ 7325364/TinyMCE的加载琅插件主题 - 从 - 不正确的目录 – 2013-04-10 19:40:50