Rails 资产在生产中很奇怪

发布于 2024-12-20 21:42:16 字数 1632 浏览 1 评论 0原文

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'

生产.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

怎么办使固定?

Rails 3.1.3
ruby-1.9.3-p0

ckeditor path

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 network log

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

Strange that rails load js second time and wrong 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

How fix?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋心╮凉 2024-12-27 21:42:16

active_admin.rb

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

active_admin.rb

config.register_javascript '/assets/ckeditor/ckeditor.js'
config.register_javascript '/assets/ckeditor/config.js'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文