Nokogiri에서 Rails 4.2.7을 사용하고 있습니다. 내 문서에 추가 할 새로운 Nokogiri 노드를 어떻게 만듭니 까? 나는이Nokogiri 노드를 만들 수없는 이유는 무엇입니까?
general = doc.xpath("//lomimscc:general")
title = Nokogiri::XML::Node.new "lomimscc:title"
string = Nokogiri::XML::Node.new "lomimscc:string"
string.content = scenario.title
string.language = 'en'
title << string
general << title
을 할 수 있지만,
ArgumentError: wrong number of arguments (given 1, expected 2+)
from /Users/davea/Documents/workspace/sims/app/helpers/myproject_helper.rb:73:in `new'
from /Users/davea/Documents/workspace/sims/app/helpers/myproject_helper.rb:73:in `set_manifest_title'
from /Users/davea/Documents/workspace/sims/app/helpers/myproject_helper.rb:59:in `generate_manifest_file