Skip to content

Instantly share code, notes, and snippets.

@timhaines
Created February 22, 2012 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timhaines/1880073 to your computer and use it in GitHub Desktop.
Save timhaines/1880073 to your computer and use it in GitHub Desktop.
Name Display in Page Title
def name_for_page_title user
result = "@" + user.screen_name
if I18n.locale == :en
result += user.screen_name.last == "s" ? "’" : "’s"
result += " (#{user.name.strip})" unless user.screen_name == user.name
end
return result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment