I18n: models

This commit is contained in:
Rico Sta. Cruz 2015-04-16 20:51:42 +08:00
parent e7e5b75ba4
commit 99bc4f69f4
1 changed files with 13 additions and 4 deletions

View File

@ -96,14 +96,11 @@ en:
## ActiveRecord ## ActiveRecord
### Attributes ### Models
```rb ```rb
User.model_name.human #=> "User" User.model_name.human #=> "User"
Child.model_name.human(count: 2) #=> "Children" Child.model_name.human(count: 2) #=> "Children"
User.human_attribute_for :name #=> "Name"
``` ```
{:.light}
```yml ```yml
en: en:
@ -113,6 +110,18 @@ en:
child: child:
one: "Child" one: "Child"
other: "Children" other: "Children"
```
### Attributes
```rb
User.human_attribute_for :name #=> "Name"
```
{:.light}
```yml
en:
activerecord:
attributes: attributes:
user: user:
# activerecord.attributes.<model>.<field> # activerecord.attributes.<model>.<field>