diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-23 02:42:22 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-23 02:54:07 +0530 |
commit | eac264d74754eee6f157a75e386031ccbccd4328 (patch) | |
tree | 149f96d550114300adccc7386495b724b356178d | |
parent | 02ee2003a8040e9e8de5f3258f88dfaaade06c27 (diff) | |
download | rails-eac264d74754eee6f157a75e386031ccbccd4328.tar.gz rails-eac264d74754eee6f157a75e386031ccbccd4328.tar.bz2 rails-eac264d74754eee6f157a75e386031ccbccd4328.zip |
updating to_xml example to new AR api
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index d4dda88937..4d5baff86b 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -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> |