How to add a paperclip image from a Complex form!

0 views
Skip to first unread message

SH

unread,
Nov 4, 2009, 11:38:49 AM11/4/09
to Paperclip Plugin
I am newbie to rails and this might sound very basic. But I am puzzled
on how to do this.
My scenario is something like this.
Blog has many posts.
Now i want to upload some pictures say header/footer banners from the
user in the posts form.
These images will be in a Design model.
Blog has many designs. Design has many posts.

Can you just tell me if my approach to implement this is right?

script/generate paperclip design header

Have a file_fields in the form for post.

Now how do i get to save the image in the design model?
Should i have virtual attributes for header_file_name,
header_content_type, header_file_size, header_updated_at and set it
in the setter method.

Is this possible? Please Help!

Thanking you,
SH
Reply all
Reply to author
Forward
0 new messages