Link to home
Start Free TrialLog in
Avatar of davemlynch
davemlynchFlag for Ireland

asked on

Paperclip image renaming


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

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.
has_attached_file :data, :styles => { :large => "371*251>", :small =>
                    :url  => "/assets/:id",
                    :path =>

  belongs_to :attachable, :polymorphic => true

Open in new window

Avatar of davemlynch
Flag of Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial