From ada5832dae47b8284d07ce1ae77c21f0560b3778 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 11 Feb 2015 00:47:38 +0100 Subject: [PATCH] Customized file path to screenshot files --- app/models/screenshot.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/screenshot.rb b/app/models/screenshot.rb index 3f3af16..7162dab 100644 --- a/app/models/screenshot.rb +++ b/app/models/screenshot.rb @@ -8,8 +8,9 @@ class Screenshot < ActiveRecord::Base has_attached_file :image, styles: { :large => "800x600>", :thumb => "160x120>" }, default_url: "/images/dummy/no-screenshots-upload-one.svg", - path: ":rails_root/public/system/:class/:attachment/:id_partition/:style/:filename", - url: "/system/:hash.:extension", + #path: ":rails_root/public/system/:class/:attachment/:id_partition/:style/:filename", + path: ":rails_root/public/screenshots/:id_partition/:style.png", + url: "/screenshots/:id_partition/:style.png", hash_secret: "M4xGM9v6y17Y27sZ1liWrnQaXdX4YDdZCJ7fOqcAUg3cZJqK9x" validates_attachment_content_type :image, :content_type => /\Aimage\/png\Z/