# Paperclip

**URL:** <https://discuss.rubyonrails.org/t/paperclip/49371>\
**Category:** rubyonrails-talk\
**Created:** [February 15, 2010, 3:21pm UTC](https://discuss.rubyonrails.org/t/paperclip/49371 "2010-02-15T15:21:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [February 15, 2010, 3:21pm UTC](https://discuss.rubyonrails.org/t/paperclip/49371/1 "2010-02-15T15:21:38Z")

</div>

Hi,

Wondering is there a way in paperclip to rename images as the are being saved to image\_id+count ?

my code in image.rb model

&nbsp;&nbsp;has\_attached\_file :data, :styles =\> { :large =\> "371\*251\>", :small =\> "72\*72\>"}, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:url =\> "/assets/:id", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:path =\> ":rails\_root/assets/docs/:id/:style/:basename.:extension"

&nbsp;&nbsp;belongs\_to :attachable, :polymorphic =\> true

I am attaching file using javascript.

What i am trying to do is when i want to call back images into array I want frist image to be large and second and third to be small. So if i could change name of images to be image\_id plus count in array as name i would know that id\_1 is large and so on.
