ruby-on-railsxmlxml-builder

ruby on rails xml builder question


Anybody know how to produce an xml element like this in rails using xml Builder?
<image:loc>http://example.com/image.jpg</image:loc>

xml.image :loc http://example.com/image.jpg
Is supposed to work but doesn't.


Solution

  • You're pretty close, but the correct syntax is:

    xml.image :loc, "http://example.com/image.jpg"