RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

human_attribute for easy rails attribute i18n

I just launched human_attribute gem for rails attribute translation.

In YAML:

en
activerecord
attribute_values:
user:
state:
new: Just registered
ok: Active

then:

user = User.first
user.state # => "new"
user.human_value(:state) # => "Just registered"

Comments

Post a Comment

Comment abilities for non registered users are currently deactivated, pending time to add a proper CAPTCHA to solve the escalating spam problem. Sorry!