when to put images to app/asssets and when to /public/images in rails 3.1?

前端 未结 1 1073
悲&欢浪女
悲&欢浪女 2021-02-15 23:34

I still don\'t quite get it, where to put images in rails 3.1, in these situation:

  1. Images are processed (f.e. by paperclip or by dragonfly ) and stored in folder (
1条回答
  •  悲&欢浪女
    2021-02-16 00:12

    Stylesheet images should be placed in app/assets, while files uploaded by paperclip in public/system. In case of assets , fingerprints will be created for every file, so they can be properly cached. If cached file changes, fingerprint changes too and in such way cache is invalidated.

    UPDATE: To reference files in app/assets (e.g. specifying image url in css) you`ll need to use special asset pipeline ERB or SCSS helpers (like image-path and image-url for SCSS and asset_path for ERB).

    0 讨论(0)
提交回复
热议问题