클립 클립 보간을 사용해야합니다. 이 클립 3.5.2
class User < ActiveRecord::Base
extend FriendlyId
friendly_id :name, use: [ :slugged, :finders ]
Paperclip.interpolates :slug do |attachment, style|
attachment.instance.slug
end
has_attached_file :picture,
styles: { large: "512x512!", medium: "256x256!", thumb: "128x128!" },
default_url: "/images/:class/:style/missing.png",
hash_secret: "xxxxxxxxxxxxxxxxxxxxxx",
url: "/system/:class/:attachment/:slug/:style/:hash.:extension",
path: ":rails_root/public/system/:class/:attachment/:slug/:style/:hash.:extension"
end
또한 파일 이름에 개인 정보를 숨길 수있는 해시 파일 이름을 사용하는 방법을 보여줍니다 나를 위해 작동합니다. URL에서 파일 이름을 가져 오기 위해 웹 서버에서 일부 라우팅을 설정하지 않으면 URL과 경로가 일치해야합니다.