I have a model Book that has n screenshots.
Each screenshot is an image.
I would like to use a image plugin (e.g. paperclip)
Can I store a paperclip image in an array and serialize?
Is there a better way?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should probably create a table and model for each
Screenshotand then set up ahas_manyrelationship fromBooktoScreenshot, and abelongs_tofromScreenshottoBook.Then
Screenshotwould use the paperclip plugin to handle the attachment in whatever way you like, though I recommend storing it either on the filesystem or on something like Amazon’s S3, both of which the plugin should help you do. Whatever you do, don’t store them in the database as it’s horribly inefficient and doesn’t let you take advantage of fast file servers like Apache, Nginx, or S3.