【问题标题】:rails assets strange in productionrails资产在生产中很奇怪
【发布时间】:2012-01-19 22:36:53
【问题描述】:
Rails 3.1.3
ruby-1.9.3-p0

ckeditor 路径

rails gckeditor:install --path=app/assets/ckeditor

active_admin.rb

config.register_javascript 'ckeditor/ckeditor.js'
config.register_javascript 'ckeditor/config.js'

production.rb

config.assets.compile = true

Firebug 网络日志

http://192.168.232.130:3000/admin/posts/new
http://192.168.232.130:3000/assets/active_admin-8d11a9c33e6523c7caa3885e639a6141.css
http://192.168.232.130:3000/assets/active_admin-d9973bd5416a9bd593fceac194c20b0c.js
http://192.168.232.130:3000/assets/ckeditor/ckeditor-e04a6d38d55af60f6ce20610e5b0e7eb.js
http://192.168.232.130:3000/assets/ckeditor/config-c9d860941a21f95f832013923f6cb981.js
http://192.168.232.130:3000/admin/posts/config.js?t=B8DJ5M3
http://192.168.232.130:3000/admin/posts/skins/kama/editor.css?t=B8DJ5M3
http://192.168.232.130:3000/admin/posts/lang/en.js?t=B8DJ5M3
http://192.168.232.130:3000/admin/posts/plugins/embed/plugin.js?t=B8DJ5M3
http://192.168.232.130:3000/admin/posts/plugins/attachment/plugin.js?t=B8DJ5M3

奇怪的是rails第二次加载js和错误的url

http://192.168.232.130:3000/admin/posts/config.js?t=B8DJ5M3
http://192.168.232.130:3000/admin/posts/skins/kama/editor.css?t=B8DJ5M3
http://192.168.232.130:3000/admin/posts/lang/en.js?t=B8DJ5M3
http://192.168.232.130:3000/admin/posts/plugins/embed/plugin.js?t=B8DJ5M3
http://192.168.232.130:3000/admin/posts/plugins/attachment/plugin.js?t=B8DJ5M3

如何解决?

【问题讨论】:

    标签: ruby-on-rails ckeditor production activeadmin


    【解决方案1】:

    active_admin.rb

    config.register_javascript '/assets/ckeditor/ckeditor.js'
    config.register_javascript '/assets/ckeditor/config.js'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-11
      • 1970-01-01
      • 2014-07-30
      • 2016-06-11
      • 2017-05-25
      • 2015-02-23
      • 1970-01-01
      相关资源
      最近更新 更多