Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Translate model attribute values from locales

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

Human Attribute

  1. Defines method "human_name" for attribute name translation;
  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) 2012 divineforest, Evrone.com

Something went wrong with that request. Please try again.