Ruby on rails 将Rails 3.2与CKEditor集成:未能加载资源:皮肤包
我在将Rails应用程序与CKEditor集成时遇到问题。我遵循了从这里得到的指示。我将提取的文件夹(ckeditor)复制到/assets/javascript,并在我的页面上添加了这样一行Ruby on rails 将Rails 3.2与CKEditor集成:未能加载资源:皮肤包,ruby-on-rails,ruby,ruby-on-rails-3.2,ckeditor,Ruby On Rails,Ruby,Ruby On Rails 3.2,Ckeditor,我在将Rails应用程序与CKEditor集成时遇到问题。我遵循了从这里得到的指示。我将提取的文件夹(ckeditor)复制到/assets/javascript,并在我的页面上添加了这样一行 <script type="text/javascript"> var CKEDITOR_BASEPATH = '/assets/ckeditor/'; </script> <script type="text/javascript"> $(functio
<script type="text/javascript">
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
</script>
<script type="text/javascript">
$(function(){
CKEDITOR.replace( 'editor',
{
// Optional params:
skin: 'office2003' // I change it to 'moono' and everything works well
height: '300px'
});
})
</script>
我使用Rails 3.2并下载了最新版本的CKEditor 4.1.1
有什么建议吗?啊,我的错,我没有在我的页面上添加下面的JS脚本
<script type="text/javascript">
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
</script>
<script type="text/javascript">
$(function(){
CKEDITOR.replace( 'editor',
{
// Optional params:
skin: 'office2003' // I change it to 'moono' and everything works well
height: '300px'
});
})
</script>
$(函数(){
CKEDITOR.replace('editor',
{
//可选参数:
皮肤:'office2003'//我把它改为'moono',一切都很好
高度:“300px”
});
})
config.js:
CKEDITOR.editorConfig = function (config) {
config.extraPlugins = 'syntaxhighlight';
config.skin = 'office2003'; //tested OK
config.toolbar =
[..................]
};
我的工作方式是:
ckeditor/skins
文件夹下,如果没有skins
文件夹,则创建一个ckeditor/config.js
文件中
CKEDITOR.editorConfig=函数(配置){
config.skin='bootstrapck';
}
//=require_tree./ckeditor
添加到application.js文件中。
您可能必须在/=require\u-tree./ckeditor
之前编写/=require\u-tree.
。我不知道为什么,但如果没有这一行,其他Java脚本就无法正确加载。此外,如果更改顺序,则无法正确加载编辑器