1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Moved view logging to after the image is sent to improve performance.

This commit is contained in:
Dan Barber 2010-12-18 08:59:58 -05:00
parent 16f9895048
commit 3379f36b61

View File

@ -19,9 +19,9 @@ class PhotosController < ApplicationController
def show
# Log the view
@photo = Photo.find(params[:id])
@photo.log_view
# Get the image and send it to the browser
data = File.open(@photo.photo.path, 'rb').read
send_data(data , :filename => 'photo', :type => 'image/jpg', :disposition => 'inline')
@photo.log_view
end
end