javascript - Ckeditor不显示在生产Rails中

标签 javascript ruby-on-rails ckeditor ruby-on-rails-5

因此,我将Ckeditor更新为4.2。完成此操作后,Ckeditor不再出现在生产中。相反,我在控制台中收到以下错误:

Uncaught TypeError: CKEDITOR.style.customHandlers[e.type] is not a constructor

我已经咨询了一些资源,包括post,该问题声称该问题在预编译中。我已经编辑了application.rb以将Ckeditor包含在预编译中,但是它仍然无法正常工作。
require_relative 'boot'

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)


module DeployTest
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
    config.assets.precompile += Ckeditor.assets
    config.assets.precompile += %w( ckeditor/* )
    config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
    config.active_record.default_timezone = :local
    config.time_zone = 'Eastern Time (US & Canada)'
  end
end

奇怪的是,当我打开config.assets.debug = true时,Ckeditor再次开始工作,但是我的CSS关闭了。
config.assets.debug为什么起作用?为什么关闭我的CSS?我如何获得ckeditor的永久解决方案?

最佳答案

使用git的ckeditor gem为我解决了这个问题

gemfile:

gem 'ckeditor', github: 'galetahub/ckeditor'

https://github.com/galetahub/ckeditor/issues/719

关于javascript - Ckeditor不显示在生产Rails中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41994025/

相关文章:

javascript - typescript 找不到名称窗口或文件

ruby-on-rails - 使用了错误的 ruby​​ 版本

Mysql 未安装 - 尝试将其与 RoR 一起使用

javascript - CKEditor - 对于每个具有类名的属性执行一些操作

css - 如何在 CKEditor 中插入用 CSS 呈现的文本?

javascript - Chrome 中的 CKEditor 光标在聚焦时不会闪烁

javascript - 如何通过单击正文上的任意位置来关闭弹出 DIV

javascript - 单击时onclick事件不添加类

javascript - localStorage.clear();从 PC 清除所有?

ruby-on-rails - alias_method、alias_method_chain 和 self.included