Ckeditor 在生产环境的 Rails 中未显示

3

我将Ckeditor更新到4.2版本后,发现它在生产环境中不再显示。相反,在控制台中出现以下错误:

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

我咨询了几个来源,包括这篇文章,声称问题在预编译中出现。我已经编辑了我的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的问题?

1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接