I have a very simple xml file that I am trying to access:
<article>
<text>hello world</text>
</article>
I'm doing this so far:
file = File.open("#{Rails.root}/public/files/#{file_id}.xml", "r")
xml = file.read
doc = REXML::Document.new(xml)
When I run this code in rails console, I see:
1.9.3-p194 :033 > doc.inspect
=> "<UNDEFINED> ... </>"
I can't seem to understand why it is not loading the file correctly, I can't access the text xml element either.