2

我在vendor/assets/javascripts /裏面有tiny_mce文件夾。在我的application.js文件中,我有:TinyMCE on Rails 4,資產管道對我來說不流暢

//= require tiny_mce/tiny_mce_src.js 

在開發中,Tiny mce編輯器起作用。在heroku上的製作中沒有。

TypeError: this.getDoc(...) is undefined 
[Break On This Error] 

... get source for: http://www.example.com/assets/application-fcf26d0749f321ac7... 

applic...2815.js (line 31035) 

Failed to load: http://www.example.com/entries/1//themes/advanced/editor_template.js 

applic...2815.js (line 27236) 

Failed to load: http://www.example.com/entries/1//langs/en.js 

這裏是tiny_mce具體代碼:

tinyMCE.init({ 
    document_base_url : "http://www.example.com/", 
    mode : "textareas" 
}); 

我認爲問題,因爲這些雙斜線的產生:

Failed to load: http://www.example.com/entries/1//themes/advanced/editor_template.js 
Failed to load: http://www.example.com/entries/1//langs/en.js 

回答

-2

進一步調試後,我發現,這是一個資產問題。我通過將其添加到config/enviroments/production.rb中的文件中解決了該問題。

config.assets.digest = false 

# Add to settle tinymce issue 
config.assets.debug = true