XmlSimple - using xml_in() to parse data in Ruby on Rails

wealthminds

New Member
I have a simple XML file like this:\[code\] <Course> <CompanyName value="http://stackoverflow.com/questions/7617467/Ford"/> <DepartmentName value="http://stackoverflow.com/questions/7617467/assessments"/> <CourseName value="http://stackoverflow.com/questions/7617467/parts"/> <Result> <CoreData> <Status value="http://stackoverflow.com/questions/7617467/completed"/>\[/code\]In my controller I have:\[code\] def xml_facil require 'xmlsimple' config = XmlSimple.xml_in("#{Rails.root}/doc/TestResults/Ford/assessments/mike.xml", { 'KeyAttr' => 'value' }) @results = config['CourseName'] end\[/code\]In my view I have:\[code\] <%= render @results %>\[/code\]but the error I get is:\[code\] undefined method `formats' for nil:NilClass\[/code\]I guess my method is returning nil here so how do I fix this so my view will render "parts"? Any help is appreciated!
 
Top