I’m using paperclip with my rails 3 app. I want to append a random string, nothing to long or crazy at the end of the file to cache bust the CDN. Anyone know a real simple way to do this?
Here is what I have currently:
has_attached_file :photo,
:styles => { :thumb => "70x70>" },
:storage => :s3,
:s3_credentials => "#{Rails.root}/config/s3.yml",
:path => "/:rails_env/public/users/:id/:style/:basename.:extension",
.....
I would like a file name like FILENAME_31313.png
Where 31313 is random every time a photo is saved.
Thank you
You can use something like this to get the job done:
Then modify your paperclip settings like so: