Can anyone point me to documentation, how to''s, etc about how to create an active resource server. I get its trivial to create a client. But I''m wanting to create a server that can be used by input forms and also by an active resource client. The big mystery to me is how (or if) the xml coming in from an active resource client gets transformed into the normal "params" argument and how exactly does that happen? Is it configurable? etc. Pointing to the code that does this would work too. I''m not sure I''m being clear but I hope so. Thank you, pedz -- 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 -~----------~----~----~----~------~----~------~--~---
Isn''t this just a matter of setting up your rails app RESTfully? I don''t think you have XML coming in from the client--just HTTP requests, with a URI (from which the routing magic derives many incoming parameters, just like it does when a request comes from a browser) and verbs (get/post, etc.) and session vars. From the point of view of your app, you don''t care whether the request came from a browser or an active resource client--communication happens, things get created, moved around, deleted, etc. ;-) Probably some of that is wrong--but my understanding is that the main reason you''d bother with the REST stuff is that you wind up w/an automatable application. -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Perry Smith Sent: Tuesday, May 20, 2008 2:36 PM To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] ActiveResource server Can anyone point me to documentation, how to''s, etc about how to create an active resource server. I get its trivial to create a client. But I''m wanting to create a server that can be used by input forms and also by an active resource client. The big mystery to me is how (or if) the xml coming in from an active resource client gets transformed into the normal "params" argument and how exactly does that happen? Is it configurable? etc. Pointing to the code that does this would work too. I''m not sure I''m being clear but I hope so. Thank you, pedz -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think that is all correct but I''ve never seen anyone talk about how the xml input gets remapped. Thats the part that I''m trying to understand in particular. Thanks -- 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 -~----------~----~----~----~------~----~------~--~---
On 21 May 2008, at 00:04, Perry Smith wrote:> > I think that is all correct but I''ve never seen anyone talk about how > the xml input gets remapped. >IIRC, it''s via ActiveRecord''s from_xml method Fred> Thats the part that I''m trying to understand in particular. > > Thanks > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 21 May 2008, at 00:04, Perry Smith wrote: > >> >> I think that is all correct but I''ve never seen anyone talk about how >> the xml input gets remapped. >> > IIRC, it''s via ActiveRecord''s from_xml method > > FredThanks! I grep''ped around and found where parse_formatted_request_parameters does the magic. Thank you again... -- 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 -~----------~----~----~----~------~----~------~--~---
@Perry, Just to be clear... You have one app with RESTful routes that does all the typical stuff that you expect to do using ActiveRecord. Normal forms posting to create and update, etc. If you''ve used the ''normal'' scaffolded controllers you don''t need to do anything new here. Then there''s the "ActiveResource'' application. This application does the same basic thing as the previous one with respect to HTTP requests. The difference is that the ActiveResource models use something similar to ''formated_model_path(@model, :xml)'' to do CRUD. That means they don''t send requests in XML -- they send ''normal'' http requests and ask for the response in XML. ActiveResource _consumes_ xml (ActiveResource::Base#load_attributes_from_response). The onus is on the ActiveResource model to parse XML, not your controllers. HTH, Andyv On May 20, 8:26 pm, Perry Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Frederick Cheung wrote: > > On 21 May 2008, at 00:04, Perry Smith wrote: > > >> I think that is all correct but I''ve never seen anyone talk about how > >> the xml input gets remapped. > > > IIRC, it''s via ActiveRecord''s from_xml method > > > Fred > > Thanks! I grep''ped around and found where > parse_formatted_request_parameters does the magic. > > Thank you again... > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---