Rails 关于 rails 生产环境图片硬编码访问问题。

wcc526 · June 16, 2014 · Last by hz_qiuyuanxin replied at June 16, 2014 · 1541 hits

把 rails 部署到生产环境以后,发现 rails 会自动在每个原来的图片的文件名后面加后缀。

比如 1.jpg 就会变成 1-c63cc576825b1ca0b799f05f6225c55b.jpg

但是我代码访问图片是硬编码的。

<%= image_tag(File.join("picture",1)) %>

造成了生产环境无法访问图片了。请问要如何解决?谢谢!

You need to Sign in before reply, if you don't have an account, please Sign up first.