aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/README.rdoc
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/README.rdoc')
-rw-r--r--activemodel/README.rdoc12
1 files changed, 12 insertions, 0 deletions
diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc
index 4adb43a015..3262bf61ac 100644
--- a/activemodel/README.rdoc
+++ b/activemodel/README.rdoc
@@ -168,7 +168,19 @@ behavior out of the box:
s = SerialPerson.new
s.serializable_hash # => {"name"=>nil}
+
+ class SerialPerson
+ include ActiveModel::Serializers::JSON
+ end
+
+ s = SerialPerson.new
s.to_json # => "{\"name\":null}"
+
+ class SerialPerson
+ include ActiveModel::Serializers::Xml
+ end
+
+ s = SerialPerson.new
s.to_xml # => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<serial-person...
{Learn more}[link:classes/ActiveModel/Serialization.html]