Skip to content

Instantly share code, notes, and snippets.

@urbanautomaton
Created August 2, 2011 13:25
Show Gist options
  • Save urbanautomaton/1120170 to your computer and use it in GitHub Desktop.
Save urbanautomaton/1120170 to your computer and use it in GitHub Desktop.
LayoutHelper
module LayoutHelper
def page_description
description = case
when @question then @question.background
when @user && @user.bio.present? then @user.bio
when @user && @user.sports.present? then @user.sports_list
when @user && [email protected]_record? then "Tribesports user: #{@user.short_name}"
when @topic then @topic.body
when @tribe then @tribe.description
when @challenge then @challenge.description
when @product then @product.description
else "Tribesports: Connect with sports people who share your interests & create your complete sports profile. We want to inspire you to get more active and improve at your sports."
end
strip_tags(description)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment