No commit activity in last 3 years
No release in over 3 years
Translate model attribute values from locales
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

Human Attribute

  1. Defines method "human_name" for attribute name translation (shortcut for class level method human_attribute_name);
  2. Defines method "human_value" for attribute value translation.

Usage example

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"

Installation

In Gemfile:

  gem 'human_attribute'

Copyright

Copyright (c) 2013 divineforest, Evrone.com

License

human_attribute is released under the MIT License.