From c27bc09e75d26cd46bcffcc65156727a3c9de054 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 1 Jul 2010 16:35:44 -0700 Subject: [PATCH] fixed user image bug --- app/helpers/application_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dda7f247d..a0e810109 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -40,9 +40,10 @@ module ApplicationHelper def owner_picture default = "#{root_url}images/user/default.jpg" image = "#{root_url}images/user/#{User.first.profile.last_name.gsub(/ /,'').downcase}.jpg" - unless File.exist?(image) + + if File.exist?("public/images/user/#{User.first.profile.last_name.gsub(/ /,'').downcase}.jpg") image_tag image, :id => "user_picture" - else File.exist?(image) + else image_tag default, :id => "user_picture" end end