我正在使用
CKEditor gem.我的app.js和routes.rb配置如下:
# application.js //= require ckeditor/init # routes.rb mount Ckeditor::Engine => '/ckeditor'
gem在开发模式下工作正常,但是当转到生产模式时,我在浏览器请求ckeditor文件夹中的js和css文件时得到错误404:
GET http://mydomain/assets/ckeditor/config.js?t=D2LI 404 (Not Found) GET http://mydomain/assets/ckeditor/skins/moono/editor.css?t=D2LI 404 (Not Found) GET http://mydomain/assets/ckeditor/lang/vi.js?t=D2LI 404 (Not Found) GET http://mydomain/assets/ckeditor/styles.js?t=D2LI 404 (Not Found)
请帮我修复我的ckeditor路由配置.先感谢您.
解决方法
您需要明确指示Rails在生产中预编译您的CKEditor资产:
# config/application.rb config.assets.precompile += Ckeditor.assets
然后,在生产环境中强制进行预编译:
rake assets:precompile:all