首页 > 解决方案 > 安装后不显示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

一切都试过了,但无论如何都不起作用,求助

标签: ruby-on-railsrubyckeditor

解决方案


这是简单的代码试试这个。不需要任何宝石

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

推荐阅读