How to remove some data form REST xml output?


#1

When user requsts a record, rails will put everything into xml output.
How to remove some junk data?

Thanks!


#2

If you can’t clear out enough “junk” with the to_xml options:

http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html#M000910

then override to_xml on your model to produce the xml you want…
probably with builder. You can also make a builder rxml template and
have the controller render that instead.

b


#3

aha, i can use “kip_instruct => true, :except => [ … ]”.

Thank you very much!!