diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-17 15:52:33 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-17 15:52:33 +1100 |
commit | fbc7c2beca0433d4b070e3292a1009a94987d5c0 (patch) | |
tree | 9bd77f856596ae0d358b34b96253fa44ee05350e /activemodel/README | |
parent | 87bd8c803b530fedde3d440f991da2726541990c (diff) | |
download | rails-fbc7c2beca0433d4b070e3292a1009a94987d5c0.tar.gz rails-fbc7c2beca0433d4b070e3292a1009a94987d5c0.tar.bz2 rails-fbc7c2beca0433d4b070e3292a1009a94987d5c0.zip |
Adding ActiveModel::Naming documentation
Diffstat (limited to 'activemodel/README')
-rw-r--r-- | activemodel/README | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/activemodel/README b/activemodel/README index d4b4489a2c..710f502aa3 100644 --- a/activemodel/README +++ b/activemodel/README @@ -113,7 +113,24 @@ functionality from the following modules: * Testing the compliance of your object - User ActiveModel::Lint to test the compliance of your object to the + Use ActiveModel::Lint to test the compliance of your object to the basic ActiveModel API... {Learn more}[link:classes/ActiveModel/Lint/Tests.html] + +* Providing a human face to your object + + ActiveModel::Naming provides your model with the model_name convention + and a human_name attribute... + + class NamedPerson + extend ActiveModel::Naming + end + + ...gives you... + + NamedPerson.model_name #=> "NamedPerson" + NamedPerson.model_name.human #=> "Named person" + + {Learn more}[link:classes/ActiveModel/Naming.html] + |