Skip to content

Instantly share code, notes, and snippets.

@langhorst
Created October 25, 2016 23:49
Show Gist options
  • Save langhorst/e4d504cdcc16cf75d93798eb3ca44bf2 to your computer and use it in GitHub Desktop.
Save langhorst/e4d504cdcc16cf75d93798eb3ca44bf2 to your computer and use it in GitHub Desktop.
xml = Nokogiri::XML::Builder.new { root { location {} } }.to_xml
# Get this:
# => "<?xml version=\"1.0\"?>\n<root>\n <location/>\n</root>\n"
#
# But want to get this:
# => "<?xml version=\"1.0\"?>\n<root>\n <location></location\n</root>\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment