This project is archived and is in readonly mode.
Add :margin option to XmlSerializer
Reported by blythe | May 22nd, 2009 @ 06:44 PM
When building custom XML with XmlSerializer (for ActiveRecord) its nice to be able to use the margin option of XMLBuilder rather than reformatting the string output or instantiating a builder.
builder = options[:builder] ||= ::Builder::XmlMarkup.new(:indent
=> options[:indent], :margin =>
options[:margin])
Comments and changes to this ticket
-
CancelProfileIsBroken August 6th, 2009 @ 02:48 PM
- Tag changed from serializer, xml to bugmash, serializer, xml
-
ThePhred August 9th, 2009 @ 07:14 PM
I was able to modify the patch to get it to cleanly apply. Tests still pass.
I've attached a patch. -
Rizwan Reza August 9th, 2009 @ 07:18 PM
verified
+1 The patch applies cleanly to 2-3-stable and all the tests pass.
This doesn't work for master though.
-
Elad Meidar August 9th, 2009 @ 07:38 PM
+1 Verified +1 patch applies for 2-3-stable with all tests.
i think that on master you can simply specify :margin in a to_xml block.
-
Derander August 9th, 2009 @ 09:00 PM
+1 verified, patch applies to 2-3-stable, all tests pass.
I agree with Elad, this shouldn't be necessary in master.
-
josh August 10th, 2009 @ 02:29 AM
- State changed from new to invalid
I don't think yet another option to the to_xml hash is going solve the worlds problems. We need a more robust way to override to_xml and do your own customizations.
-
Jeremy Kemper August 10th, 2009 @ 02:37 AM
- Tag changed from bugmash, serializer, xml to serializer, xml
- Milestone cleared.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>