Created
August 2, 2011 13:25
-
-
Save urbanautomaton/1120170 to your computer and use it in GitHub Desktop.
LayoutHelper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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