Forum: Ruby on Rails nested tags with contents in RXML

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jean-Christophe M. (Guest)
on 2007-04-19 14:44
(Received via mailing list)

I'm trying to get

   <a> foo
     <b> bar </b>

with RXML.

   xml.a('foo') {

complains about contents and blocks not being usable together.
I think my XML is valid though. Is there a way to do this, or to trick

Jean-Christophe M.
Ben M. (Guest)
on 2007-04-19 22:16
(Received via mailing list)
I think something like this should work:

xml.a {
  xml.text! 'foo'

The text! method sets the arg as text content of the element...

This topic is locked and can not be replied to.