Add "Download" link which will include post's tags in filename

This commit is contained in:
Toks
2015-06-10 23:38:25 -04:00
parent fd74f860ee
commit 0120fe8acb
2 changed files with 5 additions and 0 deletions

View File

@@ -95,6 +95,10 @@ class Post < ActiveRecord::Base
"#{Rails.root}/public/data/preview/#{file_path_prefix}#{md5}.jpg"
end
def file_name
"#{file_path_prefix}#{md5}.#{file_ext}"
end
def file_url
"/data/#{file_path_prefix}#{md5}.#{file_ext}"
end