I want to make a node that has both text content and an attribute with Nokogiri. E.g. I want to produce XML:
<root blah="value">text content</root>
I try to do this with:
Nokogiri::XML::Builder.new do
root(:blah=>"value") "text content"
end
But Ruby complains with:
create-config.rb:8: syntax error, unexpected tSTRING_BEG, expecting keyword_end
root(:blah => "value") "text content"
What am I doing wrong?
I found the solution. I had to use
{}andtext