2010-12-10 29 views

回答

1

可惜attachment_fu不支持相同的附件「接口」爲:storage => :db_file因爲它爲:storage => :file_system,但有在這裏填補的空白插件:

https://github.com/kares/attachment_fx

擴展 的文件接口:db_file後端(@see attachment_fu :存儲選項)。後臺數據庫 界面模仿:FILE_SYSTEM 存儲,數據庫數據是按需下載到公共目錄 (目標路徑前綴是 定製與:串流中刪除 選項)。

你基本上使用:file_system方法,如你已經習慣了與:db_file後端例如photo.public_filename(:small)。作爲獎勵你可以享受一些有用的傭工從擁有模式:

user.has_photo? 
user.photo_path(:small) 
user.photo_full_path