0

In my rails application I have used attachment_fu plugin for image upload.

I am new on rails, I want to store file in attachment_fu db_files table.

How to store images in db_files and which path i want to specify to display images?

Thanks

Jayashri
  • 4,073
  • 6
  • 25
  • 18

1 Answers1

1

Unfortunately attachment_fu does not support the same attachment "interface" for :storage => :db_file as it does for :storage => :file_system, but there's a plugin that fills the void here :

https://github.com/kares/attachment_fx

Extends the file interface for the :db_file backend (@see attachment_fu :storage option). The database backend interface mimics the :file_system storage, the db data is on-demand downloaded into the public directory (the target path prefix is customizable with the :path_prefix option).

You basically use the :file_system methods like You're used to with the :db_file backend e.g. photo.public_filename(:small). As a bonus You can enjoy some useful helpers from the owning model :

user.has_photo?
user.photo_path(:small)
user.photo_full_path
kares
  • 7,076
  • 1
  • 28
  • 38