PaperClip: Attach files through script/console

J

John O'gara

Worked this out for myself in a round about way, I used rest_client and
made a post locally, if anyone knows of a "neater" way I'd like to know
 
L

Luis Lavena

I'm wondering is it possible to attach a file through script/console?

image = Image.new:)storage => File.open('/path/to/my/image.png', rb))

Where:

Image is your model
storage is your paperclip definition of has_attachment.

HTH,
 
J

John O'gara

Thanks Luis, thats much neater.
Luis said:
image = Image.new:)storage => File.open('/path/to/my/image.png', rb))

Where:

Image is your model
storage is your paperclip definition of has_attachment.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top