mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Changed back to linking directly to images as performance was crap going
through a rails controller!
This commit is contained in:
parent
3379f36b61
commit
54ea0d9c33
@ -16,12 +16,8 @@ class PhotosController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
# Log the view
|
||||
def log_view
|
||||
@photo = Photo.find(params[:id])
|
||||
# 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
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<% @photos.each do |photo| %>
|
||||
|
||||
<div class="sg-11 photo" style="background: url('<%= photo.photo.url(:size11) %>')">
|
||||
<%= link_to '', photo_url(photo, :format => :jpg), :class => 'fancy' %>
|
||||
<%= link_to '', photo.photo.url, :class => 'fancy' %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
<% if @photo %>
|
||||
<div class="sg-17 photo" style="background: url('<%= @photo.photo.url(:size17) %>')">
|
||||
<%= link_to '', photo_url(@photo, :format => :jpg), :rel => 'photo', :class => 'fancy' %>
|
||||
<%= link_to '', @photo.photo.url, :class => 'fancy' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<% @photos.each do |photo| %>
|
||||
|
||||
<div class="sg-5 photo" style="background: url('<%= photo.photo.url(:size5) %>')">
|
||||
<%= link_to '', photo_url(photo, :format => :jpg), :class => 'fancy' %>
|
||||
<%= link_to '', photo.photo.url, :class => 'fancy' %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user