1

我正在尝试在生产中使用 CKeditor,但它总是失败。

日志:

Started GET "/backend/articles/lang/fr.js?t=C6HH5UF" for 127.0.0.1 at 2013-03-12 20:52:40 +0100

ActionController::RoutingError (No route matches [GET] "/backend/articles/lang/fr.js"):

Started GET "/backend/articles/skins/kama/editor.css?t=C6HH5UF" for 127.0.0.1 at 2013-03-12 20:52:40 +0100
ActionController::RoutingError (No route matches [GET] "/backend/articles/skins/kama/editor.css"):

在我的 prodcution.rb 中:

  config.serve_static_assets = true

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true

我已经尝试根据这个问题明确添加文件 => 如何获取 ckeditor 资源以在 Rails 3.1 资产管道中编译和加载

  config.assets.precompile += [ /.*config\.js/, /.*fr.js/, /.*editor.css/ ]

但它失败了......这意味着没有显示textareas。有人有想法吗?谢谢你的帮助。

4

1 回答 1

0

这可能会对您有所帮助,请尝试像这样添加:

在您的 production.rb 中:

config.assets.precompile += ['ckeditor/skins/kama/editor.css', 'ckeditor/lang/fr.js', 'ckeditor/skins/kama/editor.css']

并在布局中,在 html 的 HEAD 标签中添加这一行:

<script type="text/javascript">
  var CKEDITOR_BASEPATH = '/assets/ckeditor/';
</script>
于 2013-08-04T19:47:47.307 回答