If the default to_xml isn’t giving you want you want you can override
it yourself (to_xml does take quite a few options though - have a play
with them)
render :xml=> @user will only include the user attributes.
Is the assocation user has_one company ? If so (ie user has no
company_id attribute) then the easiest thing is probably to write a
method on user that returns the appropriate id and then use
the :methods option to to_xml to include that in the output
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.