Hi, I''m trying to get <a> foo <b> bar </b> </a> with RXML. xml.a(''foo'') { xml.b(''bar'') } 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 RXML ? Jean-Christophe Michel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think something like this should work: xml.a { xml.text! ''foo'' xml.b(''bar'') } The text! method sets the arg as text content of the element... b Jean-Christophe Michel wrote:> Hi, > > I''m trying to get > > <a> foo > <b> bar </b> > </a> > > with RXML. > > xml.a(''foo'') { > xml.b(''bar'') > } > > 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 > RXML ? > > > Jean-Christophe Michel > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---