2 class AssetUrlGenerator < UrlGenerator
3 include Sprockets::Rails::Helper
5 def for(style_name, options)
6 url = super(style_name, options)
8 if url =~ /^\/assets\/(.*)$/
17 Paperclip::Attachment.default_options[:url] = "/attachments/:class/:attachment/:id_partition/:style/:fingerprint.:extension"
18 Paperclip::Attachment.default_options[:path] = "#{ATTACHMENTS_DIR}/:class/:attachment/:id_partition/:style/:fingerprint.:extension"
19 Paperclip::Attachment.default_options[:url_generator] = Paperclip::AssetUrlGenerator