Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Translate model attribute values from locales
Ruby
Branch: master

Update README.md

* license link
* copyright 2013
latest commit 8cf1abc00f
@divineforest authored
Failed to load latest commit information.
lib
.gitignore
Gemfile First commit
README.md
Rakefile
human_attribute.gemspec

README.md

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.

Something went wrong with that request. Please try again.