updating to_xml example to new AR api

This commit is contained in:
Vijay Dev
2011-04-23 02:42:22 +05:30
parent 02ee2003a8
commit eac264d747

View File

@@ -2101,7 +2101,7 @@ h5. +to_xml+
The method +to_xml+ returns a string containing an XML representation of its receiver:
<ruby>
Contributor.all(:limit => 2, :order => 'rank ASC').to_xml
Contributor.limit(2).order(:rank).to_xml
# =>
# <?xml version="1.0" encoding="UTF-8"?>
# <contributors type="array">
@@ -2176,7 +2176,7 @@ The name of children nodes is by default the name of the root node singularized.
The default XML builder is a fresh instance of <tt>Builder::XmlMarkup</tt>. You can configure your own builder via the <tt>:builder</tt> option. The method also accepts options like <tt>:dasherize</tt> and friends, they are forwarded to the builder:
<ruby>
Contributor.all(:limit => 2, :order => 'rank ASC').to_xml(:skip_types => true)
Contributor.limit(2).order(:rank).to_xml(:skip_types => true)
# =>
# <?xml version="1.0" encoding="UTF-8"?>
# <contributors>