From 35a5443db7416fb628414ae489975400ccc3d503 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Sat, 9 Feb 2008 17:57:50 +0000 Subject: [PATCH] ActionItem41: generating faces with link to profile --- app/helpers/application_helper.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 23060c3..e912727 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -363,10 +363,19 @@ module ApplicationHelper 'default' end + # generates a image tag for the profile. + # + # If the profile has no image set yet, then a default image is used. def profile_image(profile) - image_tag(profile.image.public_filename(:thumb)) if profile.image + if profile.image + image_tag(profile.image.public_filename(:thumb)) + else + image_tag('peopleblock.png') + end end + # displays a link to the profile homepage with its image (as generated by + # #profile_image) and its name below it. def profile_image_link(profile) link_to(profile_image(profile) + tag('br') + profile.name, profile.url) end -- libgit2 0.21.2