Sorry if I’m missing something here but I’ve simply created a respond_to
block with an xml type in it so that user can go to www.foo.com/foos.xml
and get xml back. Works fine but I need the foo_id in there and I don’t
see it!
How can I force it’s inclusion or can you think of a reason why it might
not be there - all the other fields for the record seem to be there as
far as I can see?
Hi
Can you paste the code? Is there id in generated xml?
Sijo
Hi Sijo, thanks for the post…
Just for the record this great blog post answered it for me…
Needed to use a “builder” file, in there I can specify just how I’d like
the XML. Genius!
BB
You can also override the to_xml method in the model.
http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html
On Fri, Nov 13, 2009 at 4:59 AM, bingo bob
<[email protected]
wrote:
BB
Posted via http://www.ruby-forum.com/.
–
Darian Shimy