在轨道上工作,图像不可见并出错.
Started GET "/assets/home.png" for 127.0.0.1 at 2012-06-19 12:23:24 +0530 Served asset /home.png - 404 Not Found (24ms) ActionController::RoutingError (No route matches [GET] "/assets/home.png"):
我用过命令
rake assets:precompile
production.rb
config.assets.compress = true config.assets.compile = false
application.rb中
config.assets.enabled = true config.assets.version = '1.0'
谢谢你的帮助!
实际上,您无法使用/assets/home.png路径引用您的图像.
它将在开发模式下工作,但在生产中,您的所有资产都在其文件名中有指纹(请阅读此 http://guides.rubyonrails.org/asset_pipeline.html#what-is-fingerprinting-and-why-should-i-care-questionmark)
它将在开发模式下工作,但在生产中,您的所有资产都在其文件名中有指纹(请阅读此 http://guides.rubyonrails.org/asset_pipeline.html#what-is-fingerprinting-and-why-should-i-care-questionmark)
这就是为什么,在启用资产管道的应用程序中,您需要使用辅助方法来引用所有资产.阅读本文档,了解Ruby,JS和Sass文件中可用的不同助手:http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。