From f8e4faca2143426ee6c24fb5c6036ea6cf7b703e Mon Sep 17 00:00:00 2001 From: halida Date: Tue, 4 Dec 2012 20:18:58 +0800 Subject: [PATCH] fix bug --- .../simple_email_tracker/email_trackers_controller.rb | 7 ++++--- lib/simple_email_tracker/version.rb | 2 +- lib/simple_email_tracker/view_helper.rb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/simple_email_tracker/email_trackers_controller.rb b/app/controllers/simple_email_tracker/email_trackers_controller.rb index 49cd568..eb92272 100644 --- a/app/controllers/simple_email_tracker/email_trackers_controller.rb +++ b/app/controllers/simple_email_tracker/email_trackers_controller.rb @@ -4,10 +4,11 @@ class EmailTrackersController < ::ApplicationController def show v = Visit.find_by_uuid params[:uuid] v.visit_by request - send_file( - File.expand_path("../../../assets/images/t.gif", __FILE__), + send_data( + File.read(File.expand_path("../../../assets/images/t.gif", __FILE__)), filename: "t.gif", - type: "image/pdf") + disposition: 'inline', + type: "image/gif") end end diff --git a/lib/simple_email_tracker/version.rb b/lib/simple_email_tracker/version.rb index a31ae46..0dc5386 100644 --- a/lib/simple_email_tracker/version.rb +++ b/lib/simple_email_tracker/version.rb @@ -1,3 +1,3 @@ module SimpleEmailTracker - VERSION = "0.0.2" + VERSION = "0.0.3" end diff --git a/lib/simple_email_tracker/view_helper.rb b/lib/simple_email_tracker/view_helper.rb index ad9938b..4497c1f 100644 --- a/lib/simple_email_tracker/view_helper.rb +++ b/lib/simple_email_tracker/view_helper.rb @@ -2,7 +2,7 @@ module SimpleEmailTracker module ViewHelper def set_email_tracker *args et = SimpleEmailTracker::Visit.get_by_key args - "#{root_url}email_trackers/#{et.uuid}/t.gif" + image_tag "#{root_url}email_trackers/#{et.uuid}/t.gif" end end end