How to create Nokogiri node if node name collide with Nokogiri::XML::Builder methods

Updated . Posted . Visible to the public. Repeats.

Suppose you want to create node with name text, but this method already present in Nokogiri::XML::Builder. The solution is to add underscore after node name:

Nokogiri::XML::Builder.new do |xml|
  xml.text_ 'something' # this should create node with name 'text'
end
konjoot
Last edit
konjoot
Posted by konjoot to wiki (2014-12-15 06:19)