I had this inappropriate Paperclip configurator:
class Photo < ActiveRecord::Base
has_attached_file :image, :storage => :s3,
:styles => { :medium => "600x600>", :small => "320x320>", :thumb => "100x100#" },
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:path => "/:style/:filename"
end
This is a mistake because two images cannot have the same size and file name. To fix this, I changed the configuration to:
class Photo < ActiveRecord::Base
has_attached_file :image, :storage => :s3,
:styles => { :medium => "600x600>", :small => "320x320>", :thumb => "100x100#" },
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:path => "/:style/:id_:filename"
end
Unfortunately, this breaks all the URLs into attachments that I have already created. How can I update these file paths or otherwise make the urls work?
source
share