Make XML constructor embed XML from string

I have an XML view in a rails application and you need to paste the XML from another file for testing.

I want to say "builder, just insert this line blindly because it is already xml", but I do not see anything in the documents that do this.

+3
source share
1 answer

I knew that I could understand this after posting the question. Using the goal! this is the answer

xml.Foo do
  xml.built('build with builder')
  xml.alsobuilt do
    xml.builtinside('built inside')
    xml.target! << my_string_with_xml
  end
end

Achieves the desired results.

+6
source

Source: https://habr.com/ru/post/1716344/


All Articles