diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb
index 13f8cc5..81305c0 100644
--- a/app/controllers/photos_controller.rb
+++ b/app/controllers/photos_controller.rb
@@ -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
diff --git a/app/views/categories/index.html.erb b/app/views/categories/index.html.erb
index 0515e4f..057d69d 100644
--- a/app/views/categories/index.html.erb
+++ b/app/views/categories/index.html.erb
@@ -17,7 +17,7 @@
<% @photos.each do |photo| %>
- <%= link_to '', photo_url(photo, :format => :jpg), :class => 'fancy' %>
+ <%= link_to '', photo.photo.url, :class => 'fancy' %>
<% end %>
diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb
index e8249d5..7ce51b2 100644
--- a/app/views/pages/index.html.erb
+++ b/app/views/pages/index.html.erb
@@ -8,7 +8,7 @@
<% if @photo %>
- <%= link_to '', photo_url(@photo, :format => :jpg), :rel => 'photo', :class => 'fancy' %>
+ <%= link_to '', @photo.photo.url, :class => 'fancy' %>
<% end %>
diff --git a/app/views/photos/index.html.erb b/app/views/photos/index.html.erb
index 368cfc9..7aaca02 100644
--- a/app/views/photos/index.html.erb
+++ b/app/views/photos/index.html.erb
@@ -27,7 +27,7 @@
<% @photos.each do |photo| %>
- <%= link_to '', photo_url(photo, :format => :jpg), :class => 'fancy' %>
+ <%= link_to '', photo.photo.url, :class => 'fancy' %>
<% end %>