ruby-on-rails - 安装后不显示ckeditor
问题描述
安装 CKedit 后不起作用。我使用了指南 - https://github.com/galetahub/ckeditor
我已经尝试了一切,但它不起作用
配置/初始化程序/assets.rb
`Rails.application.config.assets.precompile += %w(ckeditor/config.js)`
配置/初始化程序/assets.rb
//= require ckeditor/init
路线.rb
mount Ckeditor::Engine => '/ckeditor'
ActiveRecord +载波
gem 'carrierwave'
gem 'mini_magick'
rails generate ckeditor:install --orm=active_record --backend=carrierwave
一切都试过了,但无论如何都不起作用,求助
解决方案
这是简单的代码试试这个。不需要任何宝石
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>Full page editing with Document Properties plugin</title>
<script src="https://cdn.ckeditor.com/4.11.2/standard-all/ckeditor.js"></script>
</head>
<body>
<div class="container">
<textarea cols="80" id="editor1" name="editor1" rows="10">
</textarea>
</div>
<script>
CKEDITOR.replace('editor1', {
fullPage: true,
extraPlugins: 'docprops',
// Disable content filtering because if you use full page mode, you probably
// want to freely enter any HTML content in source mode without any limitations.
allowedContent: true,
height: 320
});
</script>
</body>
</html>
推荐阅读
- html - 如何下移我的内容?该部分一直重叠
- c# - ElasticSearch 匹配 int 和 string 列表
- slack - 使用 Slack Bot 提及访客?
- javascript - Javascript 不显示从 PHP 和 SQL Server 获得的数据
- android - 在 Android 错误中添加 geojson 文件(使用 try/catch 环绕)
- for-loop - 矩形的自动对齐取决于vb.net中的纸张大小
- c++ - AWS S3 C++:我应该使用 UploadFile() 还是 PutObject() 来上传文件?差异在哪里?
- mysql - 使用该现有表数据创建新表调用 Admin
- mongodb - 在区块链上保存电子商务数据的最佳方法是什么?
- php - 回显并返回打印不同的值