安装后未显示Ckeditor

时间:2019-02-07 11:00:10

标签: ruby-on-rails ruby ckeditor

安装后,CKedit不起作用。我使用了指南-https://github.com/galetahub/ckeditor

我已经尝试了一切,但没有用

config / initializers / assets.rb

`Rails.application.config.assets.precompile += %w(ckeditor/config.js)`

config / initializers / assets.rb

//= require ckeditor/init

routes.rb

mount Ckeditor::Engine => '/ckeditor'

ActiveRecord + 载波

gem 'carrierwave'
gem 'mini_magick'

rails generate ckeditor:install --orm=active_record --backend=carrierwave

一切都尝试了,但是无论如何都无法完成,请帮助

1 个答案:

答案 0 :(得分:-2)

这里是简单的代码,请尝试一下。不需要任何宝石

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