- Defines method "human_name" for attribute name translation (shortcut for class level method human_attribute_name);
- Defines method "human_value" for attribute value translation.
en.yml:
en
activerecord
attributes:
user:
state: Status
attribute_values:
user:
state:
new: Just registered
ok: Active
Then:
user = User.first
user.state # => "new"
user.human_name(:state) # => "Status"
user.human_value(:state) # => "Just registered"
In Gemfile:
gem 'human_attribute'
Copyright (c) 2013 divineforest, Evrone.com
human_attribute is released under the MIT License.