Built-in way to convert xml to an ActiveRecord Object in Rails 3?

In Rails 3, is there a way to produce an ActiveRecord object from xml in a controller without writing code yourself to explicitly parse it? Say for example, could a controller receive xml like

<user>
 <first_name>Bob</first_name>
 <last_name>Smith</last_name>
</user>

and have it produce a proper User object similar to User.new(params[:user])? This is for an api.

5
задан salmonthefish 20 April 2011 в 15:26
поделиться