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

asked on

Paperclip image renaming

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

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 =>
"72*72>"},
                    :url  => "/assets/:id",
                    :path =>
":rails_root/assets/docs/:id/:style/:basename.:extension"

  belongs_to :attachable, :polymorphic => true

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of davemlynch
davemlynch
Flag of Ireland image

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