This is my first Rails project. I’m a bit stumped on how image files should be saved in the database, since they take up a lot of space. My site is going to be one where people upload a lot of images. In my migration for creating the pictures table, would I save the image file name as a string? Also does anyone have hints on where to save the images (assets, public, etc)?
Sorry, I’m just a noob looking for a little guidance.
You should consider storing your images on Amazon’s S3 (or a similar alternative) instead of the database. You can use gems like paperclip to help you with uploading to a remote storage server.
However, if you really do want to store the binary image data in the database, then you probably want to use ‘blob’ as the column datatype.