I’ve successfully been using attachment_fu with the :file_system
storage type, but am looking to switch over to using MySQL to store
the images instead. First off, the reason I’m thinking of doing this
is to hold all images centrally. Thinking being that it will help
scalability, by avoiding filesystem related issues with multiple
machines. Yeah, maybe I’m looking too far ahead ?.
Howandever, there’s a one liner in the attachment_fu README that says
“When serving files from database storage, doing more than simply
downloading the file is beyond the scope of this document.”
OK, I respect that, but … I’m also now lost. Problem being that the
handy public_filename() method only exists for file and S3 storage
types. How does one take the binary data directly from the DB and
display it in a view ?. I spent a little time peeking at the
file_column plugin, thinking it probably had code to do this by
default, but … it didn’t jump right out at me … I’m more a jack of
all trades rather than a master of RoR :0((.
This is surely easy enough ? … i.e taking image data from a database
field ( a BLOB field in MySQL) and displaying it in an RHTML view.
Would very much appreciate a pointer on how its done, or a link to
some sample code that does this.
Thanks in Advance,