On 16 Feb 2008, at 00:49, Aryk Grosz wrote:
>
> Im creating an api for my website and Im trying to roll my own.
> I know I can use activeresource and some other packages, but really
> what
> I would like is to be able to send simple xml data back and forth.
>
> Im sticking with AR controllers since I use the respond_to block to
> output results in amf (via RubyAMF) and xml. So for the respond_to xml
> code, I want to be able to do
>
> {}.to_xml and get something that can be translated back
> equivalently. on
> the other end.
>
> Right now, if I want to get and array from xml, I have to send xml
> like:
>
"<ids>1</ids><ids>2</ids><ids>3</ids><ids>4</ids>"
to get params[:ids]
> and if its only "<ids>1</ids>", then params[:ids] is
not an array.
>
> I know Rails 2.0 is trying to make a better AR#to_xml function, but
> that
> doesnt aim at my use case.
>
> Also something like [{:foo =>
["bar","bar","bar"]}].to_xml will
> throw an
> error as well.
>
> Somebody has had to have written a mirroring to_xml / from_xml
> function
> by this point.
Hash.from_xml ?
Fred>
>
> Can anyone point me in the right direction?
> --
> 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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---