开发者

Creating both style images using paperclip

I just started using the paperclip plugin. I managed to make it work with a normal file field. From Ryan Bates's screencast, I saw that you cannot have a thumbnail image, unless you resize it explicititly at upload time. However, I would like to have both a normal image, and a thumbnail image of the same picture. How 开发者_如何学Gowould I accomplish this?


You can create several styles like

:styles => { :normal=> "1024x768>", :thumb => "100x100>" }

for exapmle

Then you can use in your view

<%= image_tag imageable.image.url(:normal) %>

where imaageable is an object which you have attached an image to

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜