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