mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
updating to_xml example to new AR api
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user