Unable to change DocumentBaseUrl in TinyMCE

I use Rails 3.2.3, and when TinyMCE loads into production, I get four 404s:

"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"

Perhaps these files are called asynchronously from tiny_mce.js because they are not listed in my source. My js look like this:

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);
}

All my TinyMCE files are in the directory dir app / assets / javascripts / tiny_mce , so I tried to add document_base_urland base_urlto my parameters init, but no matter what I set it when I check TinyMCE in firebug, I see that their values are not change to what I entered.

I am aware that kete has a Rails plugin for tinyMCE, but its README states that it is not recommended for Rails> = 3.1

+5
source share
2

document_base_url. tinymce .

<script type="text/javascript" src="/assets/vendor/tiny_mce/tiny_mce.js"></script>

make shure tinymce pipipe, config/application.rb

config.assets.precompile << 'vendor/tiny_mce/*'
0

All Articles