Skip to content

Instantly share code, notes, and snippets.

@Hates
Last active August 29, 2015 14:27
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 Hates/e54ace5580519ce267dc to your computer and use it in GitHub Desktop.
Save Hates/e54ace5580519ce267dc to your computer and use it in GitHub Desktop.
en:
karma:
admin: "admin title"
level_-1: "title1"
level_0: "title2"
level_50: "title3"
<%= t karma_title(@user) %>
module UserHelper
def karma_title(user)
return "karma.admin" if user.admin?
"karma.level_#{user.karma}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment