I want to be able to store my xml into a temporary file and then send it to another method in another controller to be processed. Currently it will not allow me to read the file, once sent, because it is a private method.
Controller #1
xml_doc = Nokogiri::XML(@builder.to_xml)
@tempfile = Tempfile.new('xml')
@tempfile.write(xml_doc)
redirect_to upload_xml_admin_events_path(:file => @tempfile)
Controller #2
Version #1
xml = params[:file].read
xmldoc = Nokogiri::XML(xml)
Gives me this error: undefined method `read' for "File:0x6ebfb00":String
Version #2
xml = params[:file]
xml.open
xmldoc = Nokogiri::XML(xml)
Gives me this error: private method `open' called for "#File:0x6a12bd8":String