# Nested RESTful Routes and creating a object from XML

**URL:** <https://www.ruby-forum.com/t/nested-restful-routes-and-creating-a-object-from-xml/110651>\
**Category:** Rails\
**Created:** [July 28, 2007, 10:05pm UTC](https://www.ruby-forum.com/t/nested-restful-routes-and-creating-a-object-from-xml/110651 "2007-07-28T22:05:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![supasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@supasta](https://www.ruby-forum.com/u/supasta)\
**Post date:** [July 28, 2007, 10:05pm UTC](https://www.ruby-forum.com/t/nested-restful-routes-and-creating-a-object-from-xml/110651/1 "2007-07-28T22:05:22Z")

</div>

I am trying to create a new model from XML that contains has a has\_many  
relationship. Is this possible without having to write code to parse  
the XML or to doing multiple POSTS? I can do a post with XML that  
doesn’t contain any of the has\_many elements and it works fine. It is  
when I add the items from the has\_many relationship that I get a bunch  
of errors.

Here are the examples I am trying

This works…  
  
orange  
This is track 3  
RFI 3  
Joe

This doesn’t  
  
orange  
This is track 3  
RFI 3  
Blow  
  
  
20.0  
25.0  
  
  
30.0  
35.0

Error from cURL about ActiveRecord::AssociationTypeMismatch in Manual  
tracksController#create

this fails too…  
  
orange  
This is track 3  
RFI 3  
Blow  
  
20.0  
25.0  
  
  
30.0  
35.0

NoMethodError in Manual tracksController#create  
undefined method `position=’ for #\<ManualTrack:0x47ec8dc\>

Any suggestions of what I need to do?  
Thanks!  
CW
