From eac264d74754eee6f157a75e386031ccbccd4328 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sat, 23 Apr 2011 02:42:22 +0530 Subject: updating to_xml example to new AR api --- railties/guides/source/active_support_core_extensions.textile | 4 ++-- 1 file 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: -Contributor.all(:limit => 2, :order => 'rank ASC').to_xml +Contributor.limit(2).order(:rank).to_xml # => # # @@ -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 Builder::XmlMarkup. You can configure your own builder via the :builder option. The method also accepts options like :dasherize and friends, they are forwarded to the builder: -Contributor.all(:limit => 2, :order => 'rank ASC').to_xml(:skip_types => true) +Contributor.limit(2).order(:rank).to_xml(:skip_types => true) # => # # -- cgit v1.2.3