0
在我的rails應用程序中,我使用attachment_fu插件進行圖片上傳。如何將圖像存儲在attachment_fu插件中的db_files中?
我是新手,我想將文件存儲在attachment_fu db_files表中。
如何將圖像存儲在db_files中以及要指定哪個路徑來顯示圖像?
感謝
在我的rails應用程序中,我使用attachment_fu插件進行圖片上傳。如何將圖像存儲在attachment_fu插件中的db_files中?
我是新手,我想將文件存儲在attachment_fu db_files表中。
如何將圖像存儲在db_files中以及要指定哪個路徑來顯示圖像?
感謝
可惜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