When I do a to_xml(with a block) on an association of a model I got a
Builder::XmlMarkup#to_ary should return Array
Example that does not work.
@intervenant = Intervenant.find(params[:id])
output = @intervenant.to_xml( :skip_types => false, :dasherize =>
false) do |xml|
@intervenant.individu.to_xml( :builder => xml, :skip_instruct =>
true, :skip_types => false, :dasherize => false) do |xml_individu|
#do special stuff at this level.....
end
end
Ex that do work but seems little bit dirty:
@intervenant = Intervenant.find(params[:id])
@individu = Individu.find(params[:id])
output = @intervenant.to_xml( :skip_types => false, :dasherize =>
false) do |xml|
@individu.to_xml( :builder => xml, :skip_instruct => true,
:skip_types => false, :dasherize => false) do |xml_individu|
#do special stuff at this level…
end
end
Any idea?