FIX: letter avatars to live in uploads directory, add last modified
This commit is contained in:
parent
aca0aa8e56
commit
9ee93aad5b
|
@ -29,6 +29,7 @@ class UserAvatarsController < ApplicationController
|
|||
end
|
||||
|
||||
image = LetterAvatar.generate(params[:username].to_s, params[:size].to_i)
|
||||
response.headers["Last-Modified"] = File.ctime(image).httpdate
|
||||
expires_in 1.year, public: true
|
||||
send_file image, disposition: nil
|
||||
end
|
||||
|
|
|
@ -25,7 +25,7 @@ class LetterAvatar
|
|||
|
||||
|
||||
def cache_path
|
||||
"tmp/letter_avatars/#{VERSION}"
|
||||
"public/uploads/letter_avatars/#{VERSION}"
|
||||
end
|
||||
|
||||
def generate(username, size, opts = nil)
|
||||
|
|
Loading…
Reference in New Issue