On Mar 16, 4:58 pm, ravenna <
t...@ravennainteractive.com> wrote:
> I am setting up a basic rental properties cms and I need to have the
> admin be able to upload images using a form. What is the best way to
> have an image1:string field be able to have an "upload" button...
You shouldn't store an image in a string field. Use a blob field.
Bette yet, if you expect to store many photos, it's best to store them
on disk. The public/system directory that will be retained by
Capistrano between deployments is a good place (and backup regularly).
In addition to attachment_fu, Paperclip is also a popular plugin:
http://thoughtbot.com/projects/paperclip
It will be easier if you can count on the client to resize the photo
to the proper dimensions. Otherwise, you'll need to install RMagick,
ImageScience, or similar to resize the photograph after it's been
uploaded.
Finally, I frequently forget to make the submitting form
multipart...it won't work without that.
Geoffrey Grosenbach
http://peepcode.com