Hi all When one sends for example a POST request with an XML body Rails parses this into a hash with a corresponding structure. How is this conversion done and where? Which XML library is used? Any pointers on where in the Rails source this is done would be helpful. Kindest regards Erik --~--~---------~--~----~------------~-------~--~----~ 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 Nov 22, 2:57 pm, Erik Lindblad <e...-gTO0lQh45js@public.gmane.org> wrote:> Hi all > > When one sends for example a POST request with an XML body Rails > parses this into a hash with a corresponding structure. How is this > conversion done and where? Which XML library is used? Any pointers on > where in the Rails source this is done would be helpful. >See http://github.com/rails/rails/tree/v2.2.2/actionpack%2Flib%2Faction_controller%2Frequest.rb#L490 You can override what happens with ActionController::Base.param_parsers[Mime::Type.lookup (''some_mime_type'')] = Proc.new do |data| #turn data into a hash of attributes end Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Worked like a charm, thanks. /Erik On 22 Nov, 16:04, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 22, 2:57 pm, Erik Lindblad <e...-gTO0lQh45js@public.gmane.org> wrote: > > > Hi all > > > When one sends for example a POST request with an XML body Rails > > parses this into a hash with a corresponding structure. How is this > > conversion done and where? Which XML library is used? Any pointers on > > where in the Rails source this is done would be helpful. > > Seehttp://github.com/rails/rails/tree/v2.2.2/actionpack%2Flib%2Faction_c... > > You can override what happens with > > ActionController::Base.param_parsers[Mime::Type.lookup > (''some_mime_type'')] = Proc.new do |data| > #turn data into a hash of attributes > end > > Fred--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---