Hi All

#controller:
@users=User.find(:all,:conditions=>["id=12"])
@faxs=FaxService.find(:all,:conditions=>["user_id=12 "])

My view is generate like this:
<?xml version="1.0" encoding="UTF-8"?>
<users>
<fax>
  <access_number_id type="integer">303</access_number_id>
</fax>
<fax>
  <access_number_id type="integer">302</access_number_id>
</fax>
<fax>
  <access_number_id type="integer">301</access_number_id>
</fax>

<fax>
  <access_number_id type="integer">305</access_number_id>
</fax>
<user>
  <country>US</country>
  <email>[email protected]</email>
  <id type="integer">12</id>
  <mobile_phone>4087723792</mobile_phone>

</user>
</users>


But i want like this
#View .rxml

<?xml version="1.0" encoding="UTF-8"?>
<users>

<user>
  <country>US</country>
  <email>[email protected]</email>
  <id type="integer">12</id>
  <mobile_phone>4087723792</mobile_phone>
   <fax>
     < access_number_id type="integer">303</access_number_id>
   </fax>
   <fax>
     <access_number_id type="integer">302</access_number_id>
   </fax>
   <fax>
      <access_number_id type="integer">301</access_number_id>
   </fax>

   <fax>
     <access_number_id type="integer">305</access_number_id>
   </fax>
</user>
</users>

can  some one tell me how to generate  xml file?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to