Hi there,

I just ran into a problem related to active resource and
incompatibility between 1.2.3 and edge.

The problem is related to my REST source (rails 1.2.3) generating xml
that looks like this:

  <people>
  <person><id type="integer">1</id><first>Ryan</first></person>
  <person><id type="integer">2</id><first>Jim</first></person>
  </people>

Whereas active resource (edge) expects it like this (from AR docs):

Collections can also be requested in a similar fashion

   # Expects a response of
   #
   # <people type="array">
   #  <person><id type="integer">1</id><first>Ryan</first></person>
   #  <person><id type="integer">2</id><first>Jim</first></person>
   # </people>
   #
   # for GET http://api.people.com:3000/people.xml
   #

I believe it would make sense to write a few lines of code in
xml_format.rb that handles this (basically figuring out that because
there is more than one direct child element called person, it should
consider it an array).

One other thing I'd like to bring up is that I think it would make
sense to make the XML format more flexible, letting people write their
own marshallers/unmarshallers on a per model basis; That way it would
be quite easy to integrate with systems that are not rails based. I
believe this would make AR more successful.

Cheers,

Stefan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to