aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/README
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-01-17 20:14:14 +1100
committerMikel Lindsaar <raasdnil@gmail.com>2010-01-17 20:14:14 +1100
commit19814df40d171b2ed83875a36d7361881ccf2e70 (patch)
tree08d0d241a0e7aafd1c3fd77db9c5802f22cd4f33 /activemodel/README
parente6063282f98b9d40da00897727e5ae01ca61b9fc (diff)
downloadrails-19814df40d171b2ed83875a36d7361881ccf2e70.tar.gz
rails-19814df40d171b2ed83875a36d7361881ccf2e70.tar.bz2
rails-19814df40d171b2ed83875a36d7361881ccf2e70.zip
Adding documentation for ActiveModel::Serialization
Diffstat (limited to 'activemodel/README')
-rw-r--r--activemodel/README14
1 files changed, 13 insertions, 1 deletions
diff --git a/activemodel/README b/activemodel/README
index 27121d2c03..95d1c63f75 100644
--- a/activemodel/README
+++ b/activemodel/README
@@ -141,4 +141,16 @@ functionality from the following modules:
functions.
{Learn more}[link:classes/ActiveModel/Observer.html]
- \ No newline at end of file
+
+* Making your object serializable
+
+ ActiveModel::Serialization provides a standard interface for your object
+ to provide to_json or to_xml serialization...
+
+ s = SerialPerson.new
+ s.serializable_hash # => {"name"=>nil}
+ s.to_json # => "{\"name\":null}"
+ s.to_xml # => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<serial-person...
+
+ {Learn more}[link:classes/ActiveModel/Serialization.html]
+