ruby on rails - Builder GEM XML formatting -


i'm using ruby gem builder, , need output..

<?xml version="1.0" encoding="utf-8"?> <fileattachment> "name of file here.xls"   <data>zip</data>   <size>7434</size> </fileattachment> 

my code below, file name next "fileattachment" isn't working.. simple i'm not seeing it?? error says can't mix text block.. makes sense don't know correct syntax.

 xml = builder::xmlmarkup.new(:indent => 2 )  xml.instruct! :xml,:version=>"1.0", :encoding => "utf-8"    xml.fileattachment("name of file here.xls")      xml.data "zip"      xml.size "7434"    end 

i think want use text! method:

xml.fileattachment   xml.text! "name of file here.xls"   xml.data "zip"   xml.size "7434" end 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -