开发者

Rails - How to Move a PaperClip Model to Another Model

Rails 3 app with paperclip.

Given a Paperclip File Model, how can you move that paperclip File to different paperclip, 开发者_运维百科say image gallery? Which would have different processing rules etc?

Any ideas?


I've just tried the following:

Given two models, with a picture attachment and their own Paperclip configurations, say: Gallery1 and Gallery2.

Given I had one object in Gallery1 with a picture already attached.

Make:

Gallery2.create(:picture => Gallery1.first.picture)

And it creates the picture properly resized with the constraints of Gallery2.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜